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

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

	int count;

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

		if (right < left) {
			break;
		}

		++left;
		--right;
		++count;
	}

	writeln(count);
}
