#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int i, j, k; //vector>(50, vector(50));; int n, m; vectors(50); int cnt = 0; cin >> n >> m; for (i = 0; i < n; i++) { cin >> s[i]; for (j = 0; j < s[i].length(); j++) { if (s[i][j] == 'W') cnt++; } } cout << cnt << endl; getchar(); getchar(); return 0; }