import Foundation

func main() {
    let n = Int(readLine()!)!
    let stones = Array(readLine()!)
    
    var rNum = 0
    var NotMovedRNum = 0
    
    for i in 1 ... n {
        let str = stones[i-1]
        if (str == "R") {
            rNum += 1
        } 
    }
    
    if (rNum == 0) {
        print(rNum)
        return
    }
    
    for i in 1 ... rNum {
        let str = stones[i-1]
        if (str == "R") {
            NotMovedRNum += 1
        } 
    }

    print(rNum -  NotMovedRNum)
}

main()