n=gets.to_i
v=gets.chomp.split("").map(&:to_s)
result=[]
red=v.count("R")
white_amount=v[0..red-1].count("W")
result<<white_amount

count=0
copy=v.dup
s=copy.unshift
while s=="R"
count+=1
s=copy.unshift
end
result<<red-count
p result.min