n = gets.to_s.to_i
c = gets.to_s.chars

l = 0
r = n - 1
ans = 0
while l < r
  if c[l] == 'W' && c[r] == 'R'
    ans += 1
    l += 1
    r -= 1
  elsif c[l] == 'W'
    r -= 1
  elsif c[r] == 'R'
    l += 1
  else
    l += 1
    r -= 1
  end
end

puts ans
