process.stdin.resume()
process.stdin.setEncoding('utf8')
var g_input = ''
process.stdin.on('data', function(chunk) {
    g_input += chunk
})
process.stdin.on('end', function() {
    main(g_input.split(/\r?\n/))
})
function main(input){
  input = input[1]
  let arr = []
  for(let i of input){
    arr.push(i)
  }

  let count = 0

  const move = ()=>{
    let mR
    let mW
    for(let i=0;i<arr.length;i++){
      if(arr[i]=='R')continue
      mW = i
      break
    }
    for(let i=arr.length-1;i>0;i--){
      if(arr[i]=='W')continue
      mR = i
      break
    }
    arr[mR] = 'W'
    arr[mW] = 'R'
    count++
    check()
  }

  const check = ()=>{
    tmp = ""
    for(let i of arr){
      if(tmp=="W"&&i=="R"){
        move()
        break
      }else{
        tmp = i
      }
    }
    console.log(count)
    process.exit(0)
  }
  
  check()

}