fun main(args: Array<String>) {
    val n = readInt()
    val c = readString()

    var numR = 0
    var numW = 0
    c.forEach {
        when(it) {
            'R' -> numR++
            'W' -> numW++
        }
    }

    var ans = 0
    for (i in 0 until numR) {
        if (c[i] == 'W') ans++
    }
    println(ans)
}

// Tools
fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()