import Foundation

let N = Int(readLine()!)!
let array = Array(readLine()!)
var wArray = Array(repeating: 0, count: N + 1)
var rc = 0
var wc = 0
for i in 0..<N{
  if(array[i] == "W"){
    wc += 1
  }else{
    rc += 1
  }
  wArray[i + 1] = wc
}
print(wArray[rc])