import kotlin.math.max
import kotlin.math.min

fun main() {
    val n = readInt()
    val colors = readLine()!!

    var red = colors.count { it == 'R' }
    var white = 0

    var best = max(white, red)
    for (i in 0 until n) {
        if (colors[i] == 'W') white++
        else red--

        best = min(best, max(white, red))
    }
    println(best)
}

private fun readInt() = readLine()!!.toInt()
private fun readInts() = readLine()!!.split(" ").map { it.toInt() }
private fun readLongs() = readLine()!!.split(" ").map { it.toLong() }
