object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val c = sc.next()
  val wc = c.scanLeft(0){case (x, c) => if (c == 'W') x+1 else x}
  val rc = c.scanRight(0){case (c, x) => if (c == 'R') x+1 else x}
  val ans = wc.zip(rc).map{ case (w, r) =>
    w.max(r)
  }.min
  println(ans)
}
