fun main(){
    val n = readLine()!!.split(" ")[0].toInt()
    val c = readLine()!!.split(" ")[0].toCharArray().toMutableList()
    var red = 0
    for (i in 0 until n){
        if (c[i] == 'R') red++
    }
    var ans = 0
    for (i in 0 until red){
        if (c[i] == 'W') ans++
    }
    println(ans)
}