N = gets.to_i
C = gets.chomp

i = 0
j = N - 1
ans = 0

while i < j
  while i < N && C[i] == 'R'
    i += 1
  end

  while j >= 0 && C[j] == 'W'
    j -= 1
  end

  if i < j
    C[i], C[j] = C[j], C[i]
    ans += 1
  end
end

puts ans
