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 (l > r) cnt
    else {
      val newL = Cs.indexOf('W', l)
      val newR = Cs.lastIndexOf('R', r)
      swap(newL + 1, newR - 1, cnt + 1)
    }
  }

  println(
    if (!Cs.contains('R') || !Cs.contains('W')) 0
    else swap(0, N - 1, 0)
  )
}