#include<bits/stdc++.h>
using namespace std;

int n, cntr=0, ans=0;
string s;

int main(){
	cin >> n >> s;
	for (char c : s){
		if (c=='R') cntr++;
	}
//	sort(s.begin(),s.end());
	for (int i=0;i<cntr;i++){
		if (s[i]=='W') ans++;
	}
	cout << ans << "\n";
}