#include using namespace std; int main() { int n,m,cnt=0; char c; cin>>n>>m; n*=m; while(n--){cin>>c;cnt+=c=='W'?1:0;} cout<