#include <bits/stdc++.h>
using namespace std;
int main() {
	int n; string s; cin >> n >> s;
	int ans = 0;
	int l = 0, r = n - 1;
	while (l < r) {
		while (l < n and s[l] == 'R') ++l;
		while (r >= 0 and s[r] == 'W') --r;
		if (l < r) swap(s[l], s[r]), ++ans;
	}
	cout << ans << "\n";
}