func main(input1: String = readLine()!, input2: String = readLine()!) {
    let stones = Array(input2)
    let numberOfR = stones.filter { $0 == "R" }.count
    let numberOfMovingW = stones[..<numberOfR].filter { $0 == "W" }.count
    print(numberOfMovingW)
}

main()