"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const C = arg[1].split("");
    
    let Rcnt = 0;
    
    for(let i=0; i<N; i++) {
        if(C[i] === "R") {
            Rcnt++;
        }
    }
    
    let tempR = [...Array(Rcnt)].fill("R");
    let tempW = [...Array(N - Rcnt)].fill("W");
    
    const splitted = tempR.concat(tempW);
    let temp = 0;
    
    for(let i=0; i<Rcnt; i++) {
        if(C[i] !== splitted[i]) temp++;
    }
    
    let answer = Math.min(temp, Math.min(Rcnt, N - Rcnt));

    console.log(answer);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));