#include #include // using namespace atcoder; using namespace std; typedef long long ll; typedef long double ld; using Graph = vector>; using vi = vector; using vll = vector; using vs = vector; using pii = pair; using pll = pair; template bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; } #define reps(i, a, n) for (ll i = (a); i < (ll)(n); ++i) #define rep(i, n) reps(i, 0, n) #define rrep(i, n) for (ll i = (ll)(n)-1; i >= 0; i--) #define ALL(box) (box).begin(), (box).end() #define all(box) (box).begin(), (box).end() #define RALL(box) (box).rbegin(), (box).rend() #define rall(box) (box).rbegin(), (box).rend() ll inf=((1LL<<62)-(1LL<<31)); ll sum = 0; ll num = 0; int pum = 0; ll mum = 0; int min1 = 1000000001; int max1 = 0; ll min2 = inf; ll max2 = -inf; ll MOD1 = 1000000007; ll MOD = 998244353; using mint = modint998244353; //using mint = modint1000000007; int dx[4] = {0, 1, 0, -1}; int dy[4] = {1, 0, -1, 0}; // 右、下、左、上 int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1}; int dy8[8] = {1, 1, 0, -1, -1, -1, 0, 1}; // sort(box.rbegin(), box.rend()); // printf("%.7Lf", n); // reverse(t.begin(), t.end()); // unique(box.begin(), box.end()); // auto It = lower_bound(ALL(box), n);以上 4 // auto It = upper_bound(ALL(box), n);含まない上 7 // cout << box.end() - It ; 末尾までの距離 // cout << It - a.begin() ; 先頭までの距離 // auto It =box.upper_bound( k);set,multiset // pqueue < int, vector, greater> q; // priority_queue, greater> pq;//小さい順 // segtree seg(N); // lazy_segtree seg(N); // box.erase(unique(all(box), box.end()); // st.erase(st.find(5)); ll zaatu(vector&A){mapm;for(auto&&x:A)m[x]=0;ll ret = 0;for(auto&&[key,val]:m)val=ret++;for(auto&&x:A)x=m[x];return ret;} void dei(const vector& G){for(auto x:G){cout <& G) {for(auto x:G){cout <>& G){for(auto x:G){for(auto y:x){cout<>& G) {for(auto x:G){for(auto y:x){cout<>& G) {for(auto x:G){for(auto y:x){cout<>& G) {for(auto x:G){for(auto y:x){cout<>>& G){for(auto x:G){for(auto y:x){for(auto z:y){cout<>a>>b;a--;b--;G[a].push_back(b);if(mukou_0_yuukou_1==0){G[b].push_back(a);}} struct edge{ ll to; ll leng; }; vector Dij(const vector>& G,int first){ int N=G.size(); vector dist(N,inf);//最短経路を保存 priority_queue, greater> pq; vector ok(N,false);//確定させる dist[first]=0;//最初の地点は0 pq.push({dist[first],first});//最初の地点から行う while(!pq.empty()){ ll n,m; tie(n,m)=pq.top(); pq.pop();//取り出し、捨てる if(ok[m]==false){//すでに確定されてないなら ok[m]=true;//確定させて dist[m]=n;//最短経路も確定させる。 for(auto x:G[m]){//その場所からいけるすべての場所を入れて、 if(ok[x.to]==false){//もしまだ確定されていないなら pq.push({dist[m]+x.leng,x.to});//{最短経路,その頂点を格納} } } } } //for(auto x:dist) cout < box,ll K){ sort(all(box)); //del(box); int N=box.size(); ll min3=inf; rep(i,N-K+1){ min3=min(min3,abs(box[K+i-1]-box[i])); } return min3; } ll power(ll a, ll b, ll m) { ll p = a, ans = 1; for(int i = 0; i < 63; i++) { ll wari = (1LL << i); if((b / wari) % 2 == 1) { ans = (ans * p) % m; } p = (p * p) % m; } return ans; }//a^b(mod m)を求める ld menseki(ld x1,ld y1,ld x2,ld y2,ld x3,ld y3){ return abs((x2-x1)*(y3-y1)-(x3-x1)*(y2-y1))/2; } ld you(ld x1, ld y1, ld x2, ld y2) { return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2); } int H,W; char ban[13][13]; void dfs(int x,int y,int sum){ if(ban[x][y]=='o'){ sum++; } if(ban[x][y]=='x'){ sum--; if(sum==-1){ return ; } } int x2=x+1; int y2=y+1; if(ban[x2][y]!='#'){ dfs(x2,y,sum); } if(ban[x][y2]!='#'){ dfs(x,y2,sum); } if(x==H-1&&y==W-1&&sum>=0){ num++; } } int main(){ cin>>H>>W; rep(i,13){ rep(j,13){ ban[i][j]='#'; } } rep(i,H){ rep(j,W){ cin>>ban[i][j]; } } dfs(0,0,0); cout <