import scala.math.min

object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val c = sc.next

  val r = c.count(_ == 'R')
  val w = c.count(_ == 'W')

  val lr = c.take(r).count(_ == 'R')
  val rw = c.takeRight(w).count(_ == 'W')

  val result = min(r - lr, min(w - rw, min(r, w)))

  println(result)
}
