function Main(input) {
	input = input.trim().split("\n").map(function(x) { return x.split(" ")});
    let N = parseInt(input[0][0], 10);
    let v_c = input[1][0];
    let countW = 0;
    let countR = 0;
    
    for (let i = 0; i < v_c.length; i++){
        if (v_c[i] === 'W') countW ++;
        else countR ++;
    }

    let selectedR = countR;

    for (let i = 0; i < countR; i++){
        if (v_c[i] === 'R') selectedR --;
    }
    
	console.log(Math.min(countW, selectedR));
	
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
