import java.util.Scanner

import scala.util.control.Breaks

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val n = sc.nextLine()
    val ss = sc.nextLine().split("").filter(_ != "")

    def rep(x: Int, y: Int): Unit = {
      val xx = ss(x)
      val yy = ss(y)
      ss(x) = yy
      ss(y) = xx
    }

    def check(wi: Int, ri: Int): Boolean = {
      if (wi < 0 || ri < 0) true
      else if (wi > ri) true
      else false
    }

    var cnt = 0
    val b = new Breaks
    b.breakable {
      while (true) {
        val lwi = ss.indexOf("W")
        val rri = ss.lastIndexOf("R")
        if (check(lwi, rri)) {
          b.break()
        } else {
          cnt += 1
          rep(lwi, rri)
        }
      }
    }

    println(cnt)

  }
}

