N=gets.to_i
c=gets.chomp.chars
i=0
while i <= 200000
  ri = c.rindex('R')
  wi = c.index('W')
  if !ri.nil? && !wi.nil? && ri >= wi
    c[ri], c[wi] = c[wi], c[ri]
  else
    break
  end
  i += 1
end
puts i
