fun main(args : Array<String>) {
    val n = readLine()!!.toInt()
    val cc = readLine()!!

    val rCnt = cc.count { it == 'R' }
    val wCnt = cc.take(rCnt).count { it == 'W' }

    println(wCnt)
}