const input = require("fs").readFileSync("/dev/stdin", "utf8")
const lines = input.split('\n')
const N = lines[0] - 0
const c = lines[1].split('')

let rm = []
for (let i = 0; i < N; i++) {
    if (c[i] === 'R') {
        rm.push(i)
    }
}
const r = rm.length
const w = N - r

let count = 0
for (let i = 0; i < r; i++) {
    if (c[i] === 'W') {
        count++
    }
}
console.log(count)
