n = gets.to_i
line = gets.chomp

count = 0
ind = 0
rind = n - 1
front = true
n.times do
  break if ind - 1 == rind

  if front
    if line[ind] == "W"
      count += 1
      front = false
    end
    ind += 1
  else
    front = line[rind] == "R"
    rind -= 1
  end
end

count -= 1 if !front
puts count