#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main() {
int n;
string map;
cin >> n;
cin >> map;
vector<int> coin_positions;
int robot_pos;
for (int i = 0; i < n; ++i) {
if (map[i] == '*') {
coin_positions.push_back(i);
} else if (map[i] == 'R') {
robot_pos = i;
}
}
int steps = 0, coins = 0;
while (!coin_positions.empty()) {
int closest_coin_index = 0;
int min_distance = INT_MAX;
for (int i = 0; i < coin_positions.size(); ++i) {
int distance = abs(coin_positions[i] - robot_pos);
if (distance < min_distance) {
min_distance = distance;
closest_coin_index = i;
} else if (distance == min_distance) {
cout << steps << " " << coins << endl;
return 0;
}
}
int new_pos = coin_positions[closest_coin_index];
steps += abs(new_pos - robot_pos);
coins++;
robot_pos = new_pos;
coin_positions.erase(coin_positions.begin() + closest_coin_index);
}
cout << steps << " " << coins << endl;
return 0;
}