using System; public class Hello { public static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var n = int.Parse(line[0]); var m = int.Parse(line[1]); var ans = 0; for (int i = 0; i < n; i++) { var s = Console.ReadLine().Trim(); ans += m - s.Replace("W", "").Length; } Console.WriteLine(ans); } }