#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{
	int n,len=0,ans=0;
	string s;
	cin>>n>>s;
	for(int i=0;i<s.size();i++)if(s[i]=='R')len++;
	for(int i=0;i<len;i++)if(s[i]=='W')ans++;
	cout<<ans<<endl;
	return 0;
}