#include #include using namespace std; int H,W; string A[10]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin>>H>>W; for(int i=0;i>A[i]; int ans=0; for(int i=0;i<1<>j&1)x++; else y++; if(x>=H||y>=W||A[x][y]=='#') { ok=false; break; } if(A[x][y]=='o')now++; else { assert(A[x][y]=='x'); now--; } if(now<0) { ok=false; break; } } if(ok) { ans++; } } cout<