n = gets.chomp.to_i
s = gets.chomp.chars

i, j = 0, n - 1

answer = 0
while i < j do
  if s[i] == 'W' && s[j] == 'R'
    s[i] = 'R'
    s[j] = 'W'
    answer += 1

    i += 1
    j -= 1
  else
    i += 1 if s[i] == 'R'
    j -= 1 if s[j] == 'W'
  end
end

puts answer
