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