#include #include int main(void){ int N, M, count=0; std::cin >> N >> M ; std::string A; for (int i = 0; i < N; i++){ std::cin >> A; for (int j = 0; j < M; j++){ if(A[j]=='W')count++; } } std::cout << count; return 0; }