import java.util.*
import kotlin.math.*
import java.io.BufferedReader
import java.io.InputStreamReader


private var fs = BufferedReader(InputStreamReader(System.`in`))
private fun readLn() = fs.readLine()!! // string line
private fun readStrings() = readLn().split(" ") // list of strings
private fun readLong() = readLn().toLong()
private fun readLongs() = readStrings().map { it.toLong() } // list of ints
private fun readInt() = readLn().toInt() // single int
private fun readInts() = readStrings().map { it.toInt() } // list of ints

fun main() {
    solveAtc()
}
fun solveAtc() {
    var n = readInt()
    var str  = readLn().toCharArray()
    var ans =0
    var w = str.filter{it -> it=='W'}.count()
    var r = str.filter{it -> it=='R'}.count()
    if(w != 0 && r != 0){
        for (i in 0 until r) {
            if (str[i] == 'W') {
                ans++
            }
        }
    }
    println(ans)
}