defmodule Main do
  def alter_altar(_n, seq) do
    r_count = Regex.scan(~r/R/, seq)
            |> Enum.count
    post_processed_seq = String.slice seq, 0, r_count
    w_count = Regex.scan(~r/W/, post_processed_seq)
            |> Enum.count
  end

 def main do
    n = IO.gets("") |> String.trim() |> String.to_integer
    seq = IO.read(:line) |> String.trim()
    IO.puts alter_altar(n, seq)
 end
end