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 PYTHON3):

Solution:
from sys import stdin
input=stdin.readline
def A():
    t=int(input())
    for _ in range(t):
        n=int(input())
        r=list(map(int,input().split()))
        s=0
        for i in r:
            if i == 1 or i == 3:
                s += 1
        print(s)

def B():
    t=int(input())
    for _ in range(t):
        a,b,c=map(int,input().split())
        a1,b1,c1=1,1,1
        while len(str(c1)) < c:
            c1 *= 2
            b1 *= 2
            a1 *= 2
        while len(str(b1)) < b:
            b1 *= 3
        while len(str(a1)) < a:
            a1 *= 5
        print(a1,b1)

def C():
    n,q=map(int,input().split())
    a=list(map(int,input().split()))
    t=list(map(int,input().split()))
    ans=[0]*q

    c=[n+2]*51
    for i in range(n):
        if c[a[i]] == n+2:
            c[a[i]] = i
    for ind in range(q):
        i=t[ind]
        x=c[i]
        for y in range(len(c)):
            if c[y] < x:
                c[y] += 1
        ans[ind]=x+1
        c[i]=0
    print(*ans)

def D():
    n,k=map(int,input().split())
    z=[chr(ord('a')+x) for x in range(26)]
    s=[]
    for a in range(k):
        s.append(z[a])
        for b in range(a+1,k):
            s.append(z[a]+z[b])
    s = ''.join(s)
    while len(s) < n:
        s *= 2
    print(s[:n])

def E():
    n,m=map(int,input().split())
    g=[0 for i in range(n)]
    s=0

    #parse inputs and count white squares
    for i in range(n):
        g[i]=list(input().rstrip())
        for j in g[i]:
            if j == 'o':
                s += 1

    #get dp array
    mod=998244353

    if s == 0:
        print(0)
        return
    
    q=[0]*(s+1)
    q[0]=0
    q[1]=0
    for i in range(2,s+1):
        q[i] = (q[i-1]+2*q[i-2] + pow(2,i-2,mod)) % mod

    seqs=[0]*(s+1)
    seq=0

    #count num consecutive horizontal white squares
    for i in range(n):
        for j in range(m):
            if g[i][j] == 'o':
                seq += 1
            else:
                if seq > 0:
                    seqs[seq] += 1
                    seq = 0
        if seq > 0:
            seqs[seq] += 1
            seq = 0

    seq=0
    #count num consecutive vertical white squares
    for j in range(m):
        for i in range(n):
            if g[i][j] == 'o':
                seq += 1
            else:
                if seq > 0:
                    seqs[seq] += 1
                    seq = 0
        if seq > 0:
            seqs[seq] += 1
            seq = 0
    #Compute sum
    tot=0
    for i in range(1,s+1):
        prod = (seqs[i] * q[i]) % mod
        prod = (prod * pow(2,s-i,mod)) % mod
        tot += prod
    print(tot % mod)

E()