let N = Int(readLine()!)!
let c = Array(readLine()!)
let reds = c.reduce(0, {$0 + ($1 == "R" ? 1 : 0)})
if reds == 0 {
    print(0)
} else {
    print(reds - c[..<reds].reduce(0, {$0 + ($1 == "R" ? 1 : 0)}))
}
