//#include #include using namespace std; //using namespace atcoder; using ll = long long; #define all(A) A.begin(),A.end() using vll = vector; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) using Graph = vector>; Graph G; vll dist; vector seen; ll mod = 1e9 + 7; ll inv(ll N) { ll a = N, b = mod, c = 1, d = 0; while (b > 0) { ll t = a / b; a -= t * b; swap(a, b); c -= t * d; swap(c, d); } c %= mod; if (c < 0)c += mod; return c; } int main() { ll N,M; cin>>N>>M; ll an=N*M; rep(i,N){ string S; cin>>S; rep(j,M){ an-=(S[j]=='W'); } } cout<