console.log((args=>{
  const [n,c] = args.trim().split`\n`;
  const N = n|0;
  let j = N, count = 0;
  for ( let i = 0; i < j; i++ ) {
    if ( c[i] === 'R' ) continue;
    for (;j > i;) {
      if ( c[j--] === 'R' ) {
        count++;
        break;
      }
    }
  }
  return count;
})(require('fs').readFileSync('/dev/stdin', 'utf8')));
