#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
int getNear(const vector<int>& vec, int target) {
int left = 0, right = vec.size() - 1;
int closest = -1, minDiff = INT_MAX, count = 0;
while (left <= right) {
int mid = left + (right - left) / 2;
int diff = abs(vec[mid] - target);
if (diff < minDiff) {
minDiff = diff;
closest = vec[mid];
count = 1;
} else if (diff == minDiff) {
count++;
if (count > 1) {
return -1;
}
}
if (vec[mid] < target) {
left = mid + 1;
} else {
right = mid - 1;
}
}
return closest;
}
int main() {
int mapSize, steps = 0, allc = 0;
vector<char> mapVec;
char el_buffer;
cin >> mapSize;
for (int i = 0; i < mapSize; i++) {
cin >> el_buffer;
mapVec.push_back(el_buffer);
}
vector<int> moneyVec;
int myPos;
for (int i = 0; i < mapSize; i++) {
if (mapVec[i] == '*') {
moneyVec.push_back(i);
} else if (mapVec[i] == 'R') {
myPos = i;
}
}
sort(moneyVec.begin(), moneyVec.end());
while (!moneyVec.empty()) {
int oldPos = myPos;
myPos = getNear(moneyVec, myPos);
if (myPos == -1) {
break;
}
mapVec[oldPos] = '.';
mapVec[myPos] = 'R';
allc++;
steps += abs(myPos - oldPos);
moneyVec.erase(remove(moneyVec.begin(), moneyVec.end(), myPos), moneyVec.end());
}
cout << steps << ' ' << allc << endl;
return 0;
}