import std.stdio;
import std.string;
import std.algorithm;

void main() {
	readln;
	auto a = readln.chomp.dup;

	int count;

	for (;;) {
		int left, right = cast(int)a.length - 1;
		while (left < a.length) {
			if (a[left] == 'W') {
				break;
			}
			++left;
		}
		while (right >= 0) {
			if (a[right] == 'R') {
				break;
			}
			--right;
		}

		if (right < left) {
			break;
		}

		swap(a[left], a[right]);
		++count;
	}

	writeln(count);
}
