process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
    const N = lines[0]-0;
    const C = lines[1].split("");
    
    let st = 0, en = N-1;
    
    let ans = 0;
    while(st<en && st<=N && en>=0){
        if(C[st]=="W" && C[en]=="R"){
           [C[st], C[en]] = [C[en], C[st]];
           ans++;
        }else if(C[st]=="R"){
            st++;
        }else if(C[en]=="W"){
            en--;
        }else{
            st++;en--;
        }
    }
    console.log(ans);
});
