N=gets.to_i
c=gets.chomp.chars
cc = c.length
mid = cc / 2
c1 = c[0, cc-mid]
c2 = c[cc-mid, mid]
w1c = c1.count('W')
r2c = c2.count('R')
puts r2c == 0 ? cc-mid - w1c :  [w1c, r2c].min
#puts [w1c, r2c].min
  
#r1c = mid + 1 - w1c
#w2c = mid + 1 - r2c

=begin
i=0
p c.gsub!(/WR/, '')
while i <= 200000
  break if c.scan(/WR/).empty?
  
  i += 1
end
puts i
=end
