let n = Int(readLine()!)!
var s = Array(readLine()!)

var red = s.filter { $0 == "R" }.count
var white = 0
var ans = Int.max

for i in -1..<n {
  if i == -1 {
    ans = min(ans, red)
    continue
  }
  red -= s[i] == "R" ? 1 : 0
  white += s[i] == "W" ? 1 : 0
  ans = min(ans, max(red, white))
}
print(ans)