n = gets.to_i
s = gets.chomp
i = 0
j = s.length-1
ans = 0
while i <= j
  if s[i] == "W" && s[j] == "R"
    s[i],s[j] = s[j],s[i]
    ans += 1
    i += 1
    j -= 1
  elsif s[i] == "R"
    i += 1
  elsif s[j] == "W"
    j -= 1
  end
end
puts ans