#include #include using namespace std; using namespace atcoder; typedef long long ll; #define rep(i, n) for (int i = 0; i < n; i++) #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) ll DP[15][15][25] ; char A[15][15] ; int main(){ ll h, w ; cin >> h >> w ; rep(i,h) rep(j,w) cin >> A[i][j] ; DP[0][0][1] = 1 ; rep(i,h){ rep(j,w){ rep(k,21){ if( A[i][j] == '#' ) continue; if( i - 1 >= 0 ){ if( A[i][j] == 'o' ) DP[i][j][k+1] += DP[i-1][j][k] ; if( A[i][j] == 'x' && k-1 >= 0 ) DP[i][j][k-1] += DP[i-1][j][k] ; } if( j - 1 >= 0 ){ if( A[i][j] == 'o' ) DP[i][j][k+1] += DP[i][j-1][k] ; if( A[i][j] == 'x' && k-1 >= 0 ) DP[i][j][k-1] += DP[i][j-1][k] ; } } } } ll ans = 0 ; rep(k,25){ ans += DP[h-1][w-1][k] ; } cout << ans << endl ; }