#include <iostream>
#include <cmath>
using namespace std;
// vector<tuple<string, int, int>> testcases = {
// make_tuple("**.*......*.R*...*..", 4, 2),
// make_tuple("***.R****", 12, 7),
// make_tuple("****R.***", 12, 7),
// make_tuple("R**********", 10, 10),
// make_tuple("*************************************R****", 0, 0),
// make_tuple("*.*.*R..*", 13, 4),
// make_tuple("*.*..R***", 11, 5),
// make_tuple("**...*R..*", 1, 1),
// make_tuple("*...R**.....*", 2, 2),
// };
int main()
{
// for (const auto &t : testcases)
// {
// string huoneet = get<0>(t);
int n;
string huoneet;
cin >> n >> huoneet;
// int n = huoneet.length();
int kolikot = 0;
int askeleet = 0;
int pos = -1;
stack<int> leftPos;
queue<int> rightPos;
for (int i = 0; i < n; i++)
{
if (huoneet.at(i) == 'R')
{
pos = i;
}
else if (huoneet.at(i) == '*')
{
if (pos != -1)
{
rightPos.push(i);
}
else
{
leftPos.push(i);
}
}
}
while (!leftPos.empty() || !rightPos.empty())
{
if (!leftPos.empty() && !rightPos.empty() && pos - leftPos.top() == rightPos.front() - pos)
{
break;
}
else if (rightPos.empty() || (!leftPos.empty() && pos - leftPos.top() < rightPos.front() - pos))
{
// Left is closer
kolikot++;
askeleet += (pos - leftPos.top());
pos = leftPos.top();
leftPos.pop();
}
else
{
// Right is closer
kolikot++;
askeleet += (rightPos.front() - pos);
pos = rightPos.front();
rightPos.pop();
}
}
cout << askeleet << " " << kolikot << "\n";
// }
return 0;
}