n = gets.to_i
stones = gets.chomp

w = 0
r = stones.count('R')
answer = r

stones.each_char do |c|
  case c
  when 'W'
    w += 1
  when 'R'
    r -= 1
  end
  answer = [answer, [w, r].max].min
end

puts answer
