
#include <stdio.h>
char s[200005];
int main(){
	int n,l,r,cnt;
	scanf("%d%s",&n,s);
	l=0,r=n-1,cnt=0;
	while(l<r){
		while(s[l]=='R')l++;
		while(s[r]=='W')r--;
		if(l<r)cnt++,s[l]='R',s[r]='W';
	}
	printf("%d\n",cnt);
	return 0;
}