#include<iostream>
#include<cassert>
using namespace std;
int H,W;
string A[10];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin>>H>>W;
	for(int i=0;i<H;i++)cin>>A[i];
	int ans=0;
	for(int i=0;i<1<<H+W-2;i++)
	{
		bool ok=true;
		int now=1;
		int x=0,y=0;
		for(int j=0;j<H+W-2;j++)
		{
			if(i>>j&1)x++;
			else y++;
			if(x>=H||y>=W||A[x][y]=='#')
			{
				ok=false;
				break;
			}
			if(A[x][y]=='o')now++;
			else
			{
				assert(A[x][y]=='x');
				now--;
			}
			if(now<0)
			{
				ok=false;
				break;
			}
		}
		if(ok)
		{
			ans++;
		}
	}
	cout<<ans<<endl;
}