import scala.math.sqrt
import scala.annotation.tailrec

object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N = sc.nextInt()
  val C = sc.next().toList
//  val rCount = C.count(_ == 'R')
//  val wCount = N - rCount

  var count = N
  // iを仕切りとして左の白、右の赤をカウント
  // 両者のmaxを試行数として、ループさせ最小を探す
  for (i <- 0 to N) {
    val (left, right) = C.splitAt(i)
    val lCount = left.count(_ == 'W')
    val rCount = right.count(_ == 'R')
    count = min(count, max(lCount, rCount))
  }

  print(count)
  
  def max(x: Int, y: Int): Int = {
    if (x > y) x else y
  }
  def min(x: Int, y: Int): Int = {
    if (x < y) x else y
  }

}