object Main extends App {
  val in = new java.util.Scanner(System.in)
  val N = in.nextInt
  val Cs = in.next.toCharArray

  def swap(l: Int, r: Int, cnt: Int): Int = {
    if (r < l) cnt
    else {
      val newL = Cs.indexOf('W', l)
      val newR = Cs.lastIndexOf('R', r)
      if (newL == -1 || newR == -1) cnt
      else swap(newL + 1, newR - 1, cnt + 1)
    }
  }

  println(swap(0, N - 1, 0))
}