n = gets.to_i
c = gets.chomp.split("").map{|c|c==?W}
idx = c.index(true)
if idx
  c = c[idx..-1]
  x = c[(c.size/2)..-1].count(false)
  y = c[0...(c.size/2)].count(true)
  #p c[0...(c.size/2)]
  p [x,y].max
else
  p 0
end
