#include #include #include #include #include #include #include #include #include #define rep(i,j,k) for(int i=(int)j;i<(int)k;i++) #define ll long long using namespace std; int day[12]={31,28,31,30,31,30,31,31,30,31,30,31}; int main(){ int h,w; cin>>h>>w; int ans=0; rep(i,0,h)rep(j,0,w){ char c; cin>>c; if(c=='W')ans++; } cout<