import java.util.Scanner;

object Main extends App {

  val sc = new Scanner(System.in);

  val len = sc.nextInt();
  val str = sc.next();

  @scala.annotation.tailrec
  def sub(str: Array[Char], answer: Int): Int = {
    val wi = str.indexOf('W');
    val ri = str.lastIndexOf('R');
    if (ri < 0) {
      0;
    } else if (wi < 0) {
      0;
    } else if (ri < wi) {
      answer;
    } else {
      val str2 = (0 until len).map { i =>
        if (i == ri) {
          'W';
        } else if (i == wi) {
          'R';
        } else {
          str(i);
        }
      }.toArray;
      sub(str2, answer + 1);
    }
  }

  val answer = sub(str.toCharArray, 0);
  println(answer);
}