n = gets.to_i
s = gets.chomp

total_r = s.count('R')
num_w = 0
num_r = 0
ans = 10**9
(n+1).times do |i|
  left_w = num_w
  right_r = total_r - num_r
  ans = [ans, [left_w, right_r].max].min
  unless i == n
    if s[i] == 'W'
      num_w += 1
    else
      num_r += 1
    end
  end
end

puts ans