#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#define PAUSE system("pause")
int getNear(const std::vector<int>& vec, int target) {
int left = 0;
int right = vec.size() - 1;
int closest = -1;
int minDiff = INT_MAX;
while (left <= right) {
int mid = left + (right - left) / 2;
int diff = abs(vec[mid] - target);
if (diff < minDiff) {
minDiff = diff;
closest = vec[mid];
}
if (vec[mid] < target) {
left = mid + 1;
} else {
right = mid - 1;
}
}
return closest;
}
int main() {
int mapSize, steps = 0, allc = 0;
std::vector<char> mapVec;
char el_buffer;
std::cin >> mapSize;
for (int i = 0; i < mapSize; i++) {
std::cin >> el_buffer;
mapVec.push_back(el_buffer);
}
std::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;
}
}
while (true) {
int oldPos = myPos;
myPos = getNear(moneyVec, myPos);
if (myPos == -1) {
break;
}
mapVec[oldPos] = '.';
mapVec[myPos] = 'R';
allc++;
steps += std::abs(myPos - oldPos);
moneyVec.erase(std::remove(moneyVec.begin(), moneyVec.end(), myPos), moneyVec.end());
}
std::cout << steps << ' ' << allc << std::endl;
PAUSE;
return 0;
}