#include using ll=long long; #define rep(i,s,n) for (ll i = (s); i < (n); i++) using namespace std; using Graph = vector>; ll MOD=1e9+7; const ll INF=1e18; int main(){ ll h,w; cin>>h>>w; ll x0,y0,x1,y1; x0=0;y0=0;x1=h-1;y1=w-1; vector G(h*w); rep(i,0,h){ rep(j,0,w){ cin>>G[i*w+j]; } } vector C(h*w); //vector seen(h*w); queue> q; q.push({x0*w+y0,0}); C[0]=1; vector dx={1,0}; vector dy={0,1}; ll ans=0; while(!q.empty()){ ll v=q.front().first; ll j=q.front().second; q.pop(); ll vx=v/w; ll vy=v%w; if(G[v]=='o'){ j++; } else if(G[v]=='x'){ j--; } else{ continue; } rep(i,0,2){ ll nx=vx+dx[i]; ll ny=vy+dy[i]; ll nv=nx*w+ny; if(nx==x1&&ny==y1){ ans++; } if(nx>=0 && nx=0 && ny