n=gets.to_i
c=gets.chomp
if !c.include?("W")||!c.include?("R")
  puts 0
  exit
end
i=c.index("W")
jj=c.reverse.index("R")
j=n-1-jj
a=0
while i<j
  a+=1
  if c.index("W",i+1)
    i=c.index("W",i+1)
  else
    break
  end
  if c.reverse.index("W",i+1)
    jj=c.reverse.index("R",jj+1)
    j=n-1-jj
  else
    break
  end
end
puts a
