import std.stdio; import std.array; import std.string; import std.conv; void main() { string[] input = split(readln()); int n = to!int(input[0]), m = to!int(input[1]); int ans = 0; foreach (i; 0..n) { string a = chomp(readln()); foreach (c; a) { if (c == 'W') ans++; } } writeln(ans); }