#include using namespace std; using uint = unsigned int; using ll = long long; using ull = unsigned long long; template using V = vector; template using VV = V>; template using VVV = V>; template using VVVV = VV>; #define rep(i,n) for(ll i=0ll;i void chmin(T& t, const U& u) { if (t > u) t = u; } template void chmax(T& t, const U& u) { if (t < u) t = u; } // cin.tie(nullptr); // ios::sync_with_stdio(false); // cout << fixed << setprecision(20); void solve(){ ll h,w; cin >> h >> w; Vv(h); rep(i,h) cin >> v[i]; ll p = (1<<(h+w-2)); ll ans = 0; rep(i,p){ ll cnt = 1; ll x = 0, y = 0; ll chk = 0; rep(j, h+w-2) chk += (i>>j)&1; if(chk != w-1) continue; rep(j,h+w-2){ if((i>>j)&1) y++; else x++; if(v[x][y]=='o') cnt++; else if(v[x][y] == 'x') cnt--; else cnt = -INF; if(cnt < 0) cnt = -INF; } if(cnt >= 0) ans++; } cout << ans << endl; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int t=1; // cin >> t; rep(i,t) solve(); }