n=gets.to_i
c=gets.chomp.chars
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
  i+=1
  while c[i]=="R"
    i+=1
    break if i>n-1
  end
  j-=1
  while c[j]=="W"
    j-=1
    break if j<0
  end
end
puts a
