function Main(input) {
  var array = input.split("\n");
  var N = array[0] - 0;
  var stone = array[1];
  var count = 0;
  var j = N;
  for (var i = 0; i < N; i++) {
    if (stone[i] === 'W') {
      for (; j > i;) {
        j--;
        if (stone[j] === 'R') {
          count++;
          break;
        }
      }
    }
  }
  console.log(count);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));