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
  let flag = false
  while(true){
    //check
    let tmp = ""
    flag = true
    for(let i of arr){
      if(tmp=="W"&&i=="R"){
        flag = false
        break
      }else{
        tmp = i
      }
    }
    if(flag)break

    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++
  }
  console.log(count)
}