#include #define rep(i,n) for(ll i=0;i<(ll)(n);i++) #define all(x) x.begin(), x.end() using namespace std; using ll=long long; using ld=long double; using P=pair; #include using namespace atcoder; //using mint=static_modint<998244353>; using mint=static_modint<1000000007>; int h,w; int main(){ cin>>h>>w; vector p(h+w-2,1); vector> a(h,vector(w)); rep(i,h)rep(j,w)cin>>a[i][j]; rep(i,w-1)p[i]=0; int ans=0; do{ bool ok=true; int x=0,y=0; int cru=1; rep(i,h+w-2){ if(p[i]==1)x++; else y++; if(a[x][y]=='#')ok=false; if(a[x][y]=='x')cru--; if(a[x][y]=='o')cru++; if(cru<0)ok=false; } if(ok)ans++; }while(next_permutation(all(p))); cout<