defmodule Main do
  def alter_altar(_n, seq) do
    res = Regex.scan(~r/WR/, 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