//
// main.cpp
// mainCode
//
// Created by Fatih Meric Koc on 28.10.2024.
//
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
pair<int, int> solve(string& s) {
int n = s.length();
int robot_pozisyon = s.find('R');
int adimlar = 0;
int paralar = 0;
// Store coin positions in vectors (left and right of robot)
vector<int> left_paralar, right_paralar;
for (int i = 0; i < n; i++) {
if (s[i] == '*') {
if (i < robot_pozisyon) {
left_paralar.push_back(i);
} else {
right_paralar.push_back(i);
}
}
}
// Reverse left_paralar to process from closest to farthest
reverse(left_paralar.begin(), left_paralar.end());
// Indices for tracking current closest paralar
int left_idx = 0;
int right_idx = 0;
while (true) {
// Get distances to closest paralar on both sides
int left_dist = (left_idx < left_paralar.size()) ?
robot_pozisyon - left_paralar[left_idx] : n;
int right_dist = (right_idx < right_paralar.size()) ?
right_paralar[right_idx] - robot_pozisyon : n;
// No more paralar
if (left_dist == n && right_dist == n) {
break;
}
// Equal distance paralar - ambiguous case
if (left_dist == right_dist) {
break;
}
// Move to closest coin
if (left_dist < right_dist) {
adimlar += left_dist;
robot_pozisyon = left_paralar[left_idx];
left_idx++;
} else {
adimlar += right_dist;
robot_pozisyon = right_paralar[right_idx];
right_idx++;
}
paralar++;
}
return {adimlar, paralar};
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
string s;
cin >> n >> s;
pair<int, int> result = solve(s);
cout << result.first << " " << result.second << "\n";
return 0;
}