func main() {
    let N = Int(readLine()!)!
    
    let A = Array(readLine()!).map { $0 == "R" ? 0 : 1 }
    let S = A.sorted(by: <)
    
    var c = 0
    for i in 0..<N {
        if A[i] != S[i] { c += 1 }
    }
    
    print(c/2)
}

main()

