function Main(input) {
  input = input.split("\n");
  var num = parseInt(input[0], 10);
  var stones = input[1].split("");
  var reds = 0, whites =0;
  for (var i=0; i<num; i++) {
    if (stones[i] === "R") {
      reds += 1;
    } else {
      whites += 1;
    }
  }
  var counter = 0;
  for (var i=reds; i<num; i++) {
    if (stones[i] === "R") {
      counter += 1;
    }
  }
  console.log(counter);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));