n = gets.chomp.to_i
ishi = gets.chomp
l = 0
r = n-1
cnt = 0
while l < r
	if ishi[l] == "R"
		l += 1
		next 
	elsif ishi[r] == "W"
		r -= 1
		next 
	end

	ishi[l] = "R"
	ishi[r] = "W"
	cnt += 1
	l += 1
	r -= 1
end
puts cnt