n = gets.to_i
s = gets.rstrip

l = 0
r = n - 1
c = 0

while l < r
  while s[l] == 'R' && l < r
    l += 1
  end

  if l >= r
    break
  end

  while s[r] == 'W' && l < r
    r -= 1
  end

  if l >= r
    break
  end

  l += 1
  r -= 1
  c += 1
end

p c
