let N = Int(readLine()!)!
var cArray: [String] = readLine()!.map { String($0) }
let countR: Int = cArray.filter { $0 == "R" }.count
let rightR: Int = cArray[countR...].filter { $0 == "R" }.count
print(rightR)