func readInt() -> Int {
    Int(readLine()!)!
}
 
func readInts() -> [Int] {
    readLine()!.split(separator: " ").map { Int($0)! }
}
 
prefix operator *
prefix func * <T> (a: [T]) -> (T, T) {return (a[0], a[1])}
prefix func * <T> (a: [T]) -> (T, T, T) {return (a[0], a[1], a[2])}

func main() {
    let n = readInt()
    let s = readLine()!

    let nr = s.lazy.filter {
        $0 == "R"
    }.count

    let ans = s.lazy.prefix(nr).filter {
        $0 == "W"
    }.count

    print(ans)
}

main()