function Main(input) {
	input = input.split("\n")  
  	let output=0
    
   // console.log(input[1],"x")
  
    for(let i=1;;i++){
      if(/WR/.test(input[1])){
		input[1] = input[1].replace(/R(W*)$/,"W$1") //一番右のR
        input[1] = input[1].replace(/^(R*)W/,"$1R") //一番左のW
        
        output++
        
    //    console.log(input[1],i)
      }else{
      	break;
      }
	}

    console.log(output)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));