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(robot).position(|c| *c=='*').unwrap_or(10000000);
VI = t.iter().rev().skip(n-robot-1).position(|c| *c=='*').unwrap_or(10000000)
}
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{10000000}else{t.iter().skip(r).position(|c| *c=='*').unwrap_or(10000000)};
let mut vasen:usize = if V{10000000}else{t.iter().rev().skip(n-r-1).position(|c| *c=='*').unwrap_or(10000000)};
if vasen == oikea ||( vasen>1000000 && oikea>1000000){print!("{} {}",STEPS, COINS); exit(0)}
if vasen>1000000{V=true}else{vasen = r - vasen}
if oikea>1000000{O=true}else{oikea = r + oikea}
if vasen < oikea{
t[vasen]='R';
STEPS+=r - vasen;
COINS +=1 ;
vasen
}else{
t[oikea]='R';
STEPS+=oikea-r;
COINS +=1 ;
oikea
}
}