#include using namespace std; int main(){ int n,m,ans=0; string s; cin>>n>>m; for(int i=0;i>s; for(int j=0;j