#include #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define rep(i,n) for (int i=0;i<(int)(n);i++) #define codefor int test;scanf("%d",&test);while(test--) #define yn(ans) cout<<(ans?"Yes":"No")< void scan(T& a){cin>>a;} template void scan(vector& a){for(auto&& it:a)scan(it);} void in(){} template void in(Head& head, Tail&... tail){scan(head);in(tail...);} //出力系 void print(int& a){printf("%d",a);} void print(long long& a){printf("%lld",a);} template void print(T& a){cout< void print(vector& vec){if(vec.empty())return;print(vec[0]);for(auto it=vec.begin();++it!= vec.end();){putchar(' ');print(*it);}} void out(){putchar('\n');} template void out(T& t){print(t);putchar('\n');} template void out(Head& head, Tail&... tail){print(head);putchar(' ');out(tail...);} //デバッグ系 template void dprint(T& a){cerr< void dprint(vector& vec){if(vec.empty())return;cerr< void debug(T& t){dprint(t);cerr< void debug(Head& head, Tail&... tail){dprint(head);cerr<<" ";debug(tail...);} int main(){ int h,w; in(h,w); char c[h][w]; int ans=0; rep(y,h){ rep(x,w){ cin>>c[y][x]; if(c[y][x]=='W')ans++; } } out(ans); }