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

ans = c.count('W')

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

ans = [ans, cnt].min
puts ans
