object Main {
  def main(args: Array[String]): Unit = {
    val num = scala.io.StdIn.readInt
    val array = scala.io.StdIn.readLine.split("")
    var count = 0
    var white_point = num - 1

    ( 0 until num ).foreach{ i =>
      if( array( i ) == "W" && white_point > i){
        while( array( white_point ) == "W" && white_point > 0 ) white_point -= 1
        array( i ) = "R"
        array( white_point ) = "W"
        if( white_point > i ) count += 1
      }
    }
    println( count )
  }
}