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