// D - Alter Altar
#include <bits/stdc++.h>
using namespace std;

int main(){
	int N; string C; cin>>N>>C;
	int r = count(C.begin(), C.end(), 'R');
	cout<< r - count(C.begin(), C.begin()+r, 'R') <<endl;
}
