#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a,W=0,w=0;
	string b;
	cin>>a>>b;
	for (int i=0;i<a;i++)
		if (b[i]=='W')
			W++;
	for (int i=a-1;i>a-W-1;i--)
		if (b[i]=='W')
			w++;
	cout<<W-w<<endl;
	return 0;
}
