#include<iostream>
using namespace std;
int main()
{
	int n;
	cin>>n;
	string s;
	cin>>s;int cou=0,cou1=0,ans1=0;
	for(int i=0;i<n;i++)
	{
		if(s[i]=='R')
		cou++;
	}
	for(int i=0;i<cou;i++)
	{
		if(s[i]=='R')
		{
			cou1++;
		}
	}
	cout<<cou-cou1<<endl;
}