use std::{process::exit, io::{BufRead, BufReader}};
static mut COINS: i32 = 0;
static mut STEPS: usize = 0;
static mut V: bool = false;
static mut O: bool = false;
static mut VI: usize = 0;
static mut OI: usize = 0;
fn main() {
let mut input = BufReader::new(std::io::stdin());
let mut line = "".to_string();
input.read_line(&mut line).unwrap();
let mut split = line.split_whitespace();
let n: usize = split.next().unwrap().parse().unwrap();
let mut robot: usize = 0;
line = "".to_string(); input.read_line(&mut line).unwrap();
let mut t: Vec<char> = line.chars().filter(|a| *a=='*'||*a=='.'||*a=='R').collect();
for i in t.iter().enumerate(){if *i.1=='R'{robot = i.0;}}
unsafe{
OI = t.iter().skip(r).position(|c| *c=='*').unwrap_or(1000000);
VI = t.iter().rev().skip(n-r-1).position(|c| *c=='*').unwrap_or(1000000)
}
loop{
unsafe{robot = step(n, &mut t,robot)}}
}
unsafe fn step(n: usize, t: &mut Vec<char>, r: usize) -> usize{
t[r]='.';
let oikea:usize = if O{1000000}else{t.iter().skip(r).position(|c| *c=='*').unwrap_or(1000000)};
if oikea == 1000000{O=true}
let vasen:usize = if V{1000000}else{r - t.iter().rev().skip(n-r-1).position(|c| *c=='*').unwrap_or(1000000)};
if vasen == 1000000{V=true}
if vasen == oikea ||( vasen>1000000 && oikea>1000000){print!("{} {}",STEPS, COINS); exit(0)}
if vasen < oikea{
t[vasen]='R';
STEPS+=r-vasen;
COINS +=1 ;
vasen
}else{
t[r+oikea]='R';
STEPS+=oikea;
COINS +=1 ;
r+oikea
}
}