import io.StdIn.{readInt, readLine}
object Main extends App {
  val n = readInt
  val wrs = readLine

  val w_count = readLine.count(_ == 'W')
  val r_count = readLine.count(_ == 'R')
  
  val case1 = w_count
  val case2 = r_count
  val case3 = w_count - wrs.takeRight(w_count).count(_ == 'W')

  val result = Array(case1, case2, case3).min
  println(result)
}