func main(input1: String = readLine()!, input2: String = readLine()!) {
    var stones = input2.map { $0 }
    var count = 0
    while let firstWPosition = stones.firstIndex(of: "W"), let lastRPosition = stones.lastIndex(of: "R"), firstWPosition < lastRPosition {
        stones.swapAt(firstWPosition, lastRPosition)
        count += 1
    }
    print(count)
}

main()