import typing import sys input = lambda: sys.stdin.readline().strip() inf = 10**18 mod = 998244353 def solve(): H, W = map(int, input().split()) grid = [] for _ in range(H): grid.append(input()) dp = [[[0 for _ in range(H*W+1)] for _ in range(W)] for _ in range(H)] dp[0][0][1] = 1 for h in range(H): for w in range(W): if grid[h][w] == 'x': for k in range(H*W): if h > 0: dp[h][w][k] += dp[h-1][w][k+1] if w > 0: dp[h][w][k] += dp[h][w-1][k+1] elif grid[h][w] == 'o': for k in range(1,H*W+1): if h > 0: dp[h][w][k] += dp[h-1][w][k-1] if w > 0: dp[h][w][k] += dp[h][w-1][k-1] else: pass print(sum(dp[-1][-1])) def main(): t = 1 for _ in range(t): solve() main()