func readInt() -> Int {
    return Int(readLine()!)!
}

func mainD() {
    let N = readInt()
    let stones = readLine()!

    let redCount = stones.reduce(0) { $0 + (String($1) == "R" ? 1 : 0) }

    print(stones.prefix(redCount).reduce(0) { $0 + (String($1) == "W" ? 1 : 0) })
}
mainD()