import java.util.*
fun main(args: Array<String>) {
    val reader = Scanner(System.`in`)
    var N = reader.nextLong()
    var str = reader.next()
    var start = 0
    var end = str.length - 1
    var findW = false
    var findR = false
    var count = 0
    do{
        if(str[start] == 'W'){
            findW = true
        }
        else {
            start += 1
        }

        if(str[end] == 'R'){
            findR = true
        }
        else {
            end -= 1
        }

        if(findW && findR){
            count += 1
            findW = false
            findR = false
            start += 1
            end -= 1
        }
    } while(start  < end)

    println(count)
}