import scala.io.StdIn._

object Main extends App {

  val n = readInt()
  val C = readLine()

  def solve() = {
    val rCnt = C.count(_ == 'R')
    (0 until rCnt).foldLeft(0) { (acc, i) =>
      if(C(i) == 'W') acc + 1 else acc
    }
  }

  println(solve())

}

