defmodule Main do def main do [n, m] = IO.gets("") |> String.trim |> String.split |> Enum.map(&String.to_integer/1) ans = for _ <- 1..n do IO.gets("") |> String.slice(0..m-1) |> String.to_charlist |> Enum.count(&(&1 === ?W)) end |> Enum.sum IO.puts ans end end