"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;
    let Wcnt = 0;
    
    let Rplace = [];
    let done = [];
    
    for(let i=0; i<N; i++) {
        if(C[i] === "R") {
            Rplace.push(i);
        }
    }
    
    let answer = 0;
    let tempR = [...Array(Rplace.length)].fill("R");
    let tempW = [...Array(N - Rplace.length)].fill("W");
    
    const splitted = tempR.concat(tempW);
    let temp = 0;
    
    for(let i=0; i<Math.ceil(N / 2); i++) {
        if(C[i] !== splitted[i]) temp++;
    }
    
    //console.log(temp)
    
    answer = Math.min(temp, Math.min(Rplace.length, N - Rplace.length));
    
    //  for(let i=0; i<N; i++) {
    //     if(C[i] === "R" && done.indexOf(i) !== -1) {
    //         continue;
    //     } else if(C[i] === "W") {
    //         Wcnt++;
    //     }
        
    //     if(Wcnt > 0 && C[i] === "R") {
    //         for(let j=0; j<Wcnt; j++) {
    //             let temp = Rplace.pop();
                
    //             if(temp === i) {
    //                 answer++;
    //                 break;
    //             }
                
    //             done.push(temp);
                
    //             answer++;
    //         }
    //     }
    //  }

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