// Vicfred
// https://atcoder.jp/contests/abc174/tasks/abc174_d
// greedy
import std.algorithm;
import std.array;
import std.conv;
import std.stdio;
import std.string;

void main() {
    const int n = readln.chomp.to!int;
    string s = readln.strip;

    int reds = 0;
    foreach(ch; s)
        if(ch == 'R')
            reds += 1;

    int ans = 0;
    for(int i = 0; i < reds; i++)
        if(s[i] == 'W')
            ans += 1;

    ans.writeln;
}
