_ = Int(readLine()!)!
let CN = Array(readLine()!)
var count = 0
for i in 0..<CN.count {
    if i == CN.count-1 {
        break
    }
    if CN[i] == "W" && CN[i+1] == "R" {
        count += 1
    }
}
print(count)
