n = gets.to_i
chars = gets.chars

r_cnt = chars.count('R')
w_cnt = 0
ans = [w_cnt, r_cnt].max
chars.each do |c|
  if c == 'R'
    r_cnt -= 1
  else
    w_cnt += 1
  end
  ans = [ans, [r_cnt, w_cnt].max].min
end
puts ans