fun main() {
  val N = readInt()
  val CN = readString().toMutableList()
  var l = 0
  var r = N - 1
  var cnt = 0
  while (true) {
    while (l < N) if (CN[l] == 'W') break else l++
    while (r >= 0) if (CN[r] == 'R') break else r--
    if (l >= r) break
    CN[l] = 'R'
    CN[r] = 'W'
    cnt++
  }
  println(cnt)
}

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