fun main() {
    val n = readLine()!!.toInt()
    val s = readLine()!!
    val rCnt = s.count { it == 'R' }
    var res = 0

    for (i in s.indices) {
        if (i < rCnt) {
            if (s[i] == 'W') res++

        } else {
            if (s[i] == 'R') res++
        }
    }
    println(res / 2)
}
