n = gets.to_i
s = gets
cnt = 0
if !(s.include?('R')&&s.include?('W'))
  puts '0'
  return
end

for i in 0...n do
  if s[n-1-i]=='R'
    rr = n-1-i
    break
  end
end

i = 0
while i < rr
  if s[i]=='W'
    cnt += 1
    s[i] = 'R'
    s[rr] = 'W'
    for j in 0..rr
      if s[rr-j]=='R'
        rr = rr-j
        break
      end
    end
  end
  i += 1
end
puts cnt