Problem: You have a large rectangular board which is divided into n × m cells (the board has n rows and m columns). Each cell is either white or black.

You paint each white cell either red or blue. Obviously, the number of different ways to paint them is 2^w, where w is the number of white cells.

After painting the white cells of the board, you want to place the maximum number of dominoes on it, according to the following rules:

  * each domino covers two adjacent cells; 
  * each cell is covered by at most one domino; 
  * if a domino is placed horizontally (it covers two adjacent cells in one of the rows), it should cover only red cells; 
  * if a domino is placed vertically (it covers two adjacent cells in one of the columns), it should cover only blue cells. 



Let the value of the board be the maximum number of dominoes you can place. Calculate the sum of values of the board over all 2^w possible ways to paint it. Since it can be huge, print it modulo 998 244 353.

Input

The first line contains two integers n and m (1 ≤ n, m ≤ 3 ⋅ 10^5; nm ≤ 3 ⋅ 10^5) — the number of rows and columns, respectively.

Then n lines follow, each line contains a string of m characters. The j-th character in the i-th string is * if the j-th cell in the i-th row is black; otherwise, that character is o.

Output

Print one integer — the sum of values of the board over all 2^w possible ways to paint it, taken modulo 998 244 353.

Examples

Input


3 4
**oo
oo*o
**oo


Output


144


Input


3 4
**oo
oo**
**oo


Output


48


Input


2 2
oo
o*


Output


4


Input


1 4
oooo


Output


9

Solution (in CPP):

Solution:
// Problem: E. Colorings and Dominoes
// Contest: Codeforces - Educational Codeforces Round 107 (Rated for Div. 2)
// URL: https://codeforces.com/contest/1511/problem/E
// Memory Limit: 512 MB
// Time Limit: 3000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll power(ll x,ll y,ll m){if(y==0)return 1;ll p=power(x,y/2,m)%m;p=(p*p)%m;return (y%2==0)?p:(x*p)%m;}
// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());int get_rand(int l, int r){uniform_int_distribution<int> uid(l,r);return uid(rng);}
vector<ll> Fac(1,1);int Last_Index = 0;
ll nCr(ll n,ll r,ll m){if(r>n) return 0;if(n>Last_Index){for(ll i=Last_Index+1;i<=n;++i){Fac.push_back(Fac[i-1]*i);Fac[i]%=m;}Last_Index=n;}return (((Fac[n]*power(Fac[r],m-2,m))%m)*power(Fac[n-r],m-2,m))%m;}ll gcd(ll a, ll b) {return (b ? gcd(b, a % b) : a);}
#define Test int t;cin>>t;while(t--)
#define endl '\n'
int Google_Test;
#define int ll
int mod = 998244353;
void solve()
{
	// cout << "Case #" << ++Google_Test << ": ";
	int n,m;
	cin >> n >> m;
	vector<string> s(n);
	for(int i=0;i<n;++i)
	cin >> s[i];
	int cnt=0;
	for(int i=0;i<n;++i)
	{
		for(int j=0;j<m;++j)
		{
			if(s[i][j]=='o')
			cnt++;
		}
	}
	if(cnt<=1)
	{
		cout << 0 << endl;
		return;
	}
	vector<int> temp;
	for(int i=0;i<n;++i)
	{
		int tcnt=0;
		for(int j=0;j<m;++j)
		{
			if(s[i][j]=='o')
			tcnt++;
			else
			{
				temp.push_back(tcnt);
				tcnt=0;
			}
		}
		temp.push_back(tcnt);
	}
	for(int j=0;j<m;++j)
	{
		int tcnt=0;
		for(int i=0;i<n;++i)
		{
			if(s[i][j]=='o')
			tcnt++;
			else
			{
				temp.push_back(tcnt);
				tcnt=0;
			}
		}
		temp.push_back(tcnt);
	}
	vector<int> ans(cnt+1);
	int tsum = 0;
	for(int i=2;i<=cnt;++i)
	{
		ans[i] = (ans[i-1] + tsum)%mod;
		if(i%2)
		{
			ans[i] = (ans[i] - power(2,(cnt-2)-(i-2),mod) + mod)%mod;
			tsum = (tsum - power(2,(cnt-2)-(i-2),mod) + mod)%mod;
		}
		else
		{
			ans[i] = (ans[i] + power(2,(cnt-2)-(i-2),mod))%mod;
			tsum = (tsum + power(2,(cnt-2)-(i-2),mod))%mod;
		}
	}
	// for(int i=2;i<=4;++i)
	// cout << ans[i] << " ";
	int fans = 0;
	for(int i:temp)
	{
		if(i<=1)
		continue;
		fans += ans[i];
		fans %= mod;
	}
	cout << fans << endl;
}
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//Test
	solve();
	return 0;
}