defmodule Main do defp f(c) do case c do "W" -> 1 _ -> 0 end end defp count(s), do: String.graphemes(s) |> Enum.map(&f/1) |> Enum.sum def main do [n, _] = IO.gets("") |> String.trim |> String.split |> Enum.map(&String.to_integer/1) a = for _ <- 1..n, do: (IO.gets("") |> String.trim) ans = Enum.map(a, &count/1) |> Enum.sum IO.puts ans end end