#include <iostream>
#include <vector>
#include <string>
int main()
{
int amount;
char rooms[50000];
int robot_index;
int steps = 0;
int coins = 0;
std::cin >> amount;
std::cin >> rooms;
std::vector<int> coin_rooms;
for(int i = 0; i < amount; i++)
{
switch(rooms[i])
{
case '*':
coin_rooms.push_back(i);
break;
case 'R':
coin_rooms.push_back(i);
robot_index = coin_rooms.size()-1;
break;
default:
break;
}
}
int d_left;
int d_right;
for(int i = 0; i < amount; i++)
{
middle = coin_rooms[robot_index];
d_left = robot_index > 0 ? coin_rooms[robot_index]-coin_rooms[robot_index-1] : 999999;
d_right = robot_index < coin_rooms[coin_rooms.size()-1] ? coin_rooms[robot_index+1]-coin_rooms[robot_index] : 999999;
if(d_left < d_right)
{
steps += d_left;
coin_rooms.erase(coin_rooms.begin()+robot_index);
robot_index--;
}
else if(d_right < d_left)
{
steps += d_right;
coin_rooms.erase(coin_rooms.begin()+robot_index);
}
else if(d_left == d_right)
{
break;
}
coins++;
}
std::cout << steps << ' ' << coins << "\n";
return 0;
}