import Foundation

func main() {
    let n = Int(readLine()!)!
    let stones = readLine()!
    
    var rNum = 0
    var NotMovedRNum = 0
    
    for i in 1 ... n {
        var str = stones[stones.index(stones.startIndex, offsetBy: i-1)..<stones.index(stones.startIndex, offsetBy: i)]
        if (str == "R") {
            rNum += 1
        }
    }
    
    
    for i in 1 ... rNum {
        var str = stones[stones.index(stones.startIndex, offsetBy: i-1)..<stones.index(stones.startIndex, offsetBy: i)]
        if (str == "R") {
            NotMovedRNum += 1
        }
    }
    print(rNum -  NotMovedRNum)
}

main()