A tourist wants to visit country Zeydabad for Zbazi (a local game in Zeydabad).

The country Zeydabad is a rectangular table consisting of *n* rows and *m* columns. Each cell on the country is either 'z' or '.'.

The tourist knows this country is named Zeydabad because there are lots of ''Z-pattern"s in the country. A ''Z-pattern" is a square which anti-diagonal is completely filled with 'z' and its upper and lower rows are also completely filled with 'z'. All other cells of a square can be arbitrary.

Note that a ''Z-pattern" can consist of only one cell (see the examples).

So he wants to count the number of ''Z-pattern"s in the country (a necessary skill for Zbazi).

Now your task is to help tourist with counting number of ''Z-pattern"s.

As input/output can reach huge size it is recommended to use fast input/output methods: for example, prefer to use gets/scanf/printf instead of getline/cin/cout in C++, prefer to use BufferedReader/PrintWriter instead of Scanner/System.out in Java.
The first line contains two integers *n*, *m* (1 ≤ *n*, *m* ≤ 3000) — the number of rows and columns respectively.

Each of the next *n* lines contains *m* characters 'z' or '.' — the description of Zeydabad.
none
4 4
zzzz
zzz.
.z..
zzzz
16
1 4
z.z.
2
2 2
zz
zz
5
from sys import stdin
input=lambda :stdin.readline()[:-1]

class segtree():
  def __init__(self,init,func,ide):
    self.n=len(init)
    self.func=func
    self.ide=ide
    self.size=1<<(self.n-1).bit_length()
    self.tree=[self.ide for i in range(2*self.size)]
    for i in range(self.n):
      self.tree[self.size+i]=init[i]
    for i in range(self.size-1,0,-1):
      self.tree[i]=self.func(self.tree[2*i], self.tree[2*i|1])
  
  def update(self,k,x):
    k+=self.size
    self.tree[k]=x
    k>>=1
    while k:
      self.tree[k]=self.func(self.tree[2*k],self.tree[k*2|1])
      k>>=1
  
  def get(self,i):
    return self.tree[i+self.size]
  
  def query(self,l,r):
    l+=self.size
    r+=self.size
    l_res=self.ide
    r_res=self.ide
    while l<r:
      if l&1:
        l_res=self.func(l_res,self.tree[l])
        l+=1
      if r&1:
        r-=1
        r_res=self.func(self.tree[r],r_res)
      l>>=1
      r>>=1
    return self.func(l_res,r_res)
  
  def debug(self,s=10):
    print([self.get(i) for i in range(min(self.n,s))])

class ordered_set:
  def __init__(self,size):
    self.inf=10**9
    self.size=size
    self.seg_cnt=segtree([0]*size,lambda x,y:x+y,0)
    self.now=[]
    
  def add(self,x):
    self.seg_cnt.update(x,1)
    self.now.append(x)
  
  def remove(self,x):
    self.seg_cnt.update(x,0)
  
  def query(self,l,r):
    return self.seg_cnt.query(l,r)
  
  def remove_all(self):
    for x in self.now:
      self.seg_cnt.update(x,0)
    self.now=[]
    

def calc(t):
  m=len(t)
  res=[0]*m
  R=0
  while R<m:
    L=R
    while R<m and t[R]=='z':
      R+=1
    while L<R:
      res[L]=R-L
      L+=1
    R+=1
  return res

h,w=map(int,input().split())
s=[]
for _ in range(h):
  s.append(input())

right=[]
for i in range(h):
  right.append(calc(s[i]))

left=[]
for i in range(h):
  left.append(calc(s[i][::-1])[::-1])

ans=0
for i in range(w):
  xy=[]
  x,y=0,i
  while 0<=y<w and 0<=x<h:
    xy.append((x,y))
    x+=1
    y-=1
  m=len(xy)
  S=ordered_set(m)
  rmv=[[] for i in range(m+1)]
  for i in range(m):
    for j in rmv[i]:
      S.remove(j)
    x,y=xy[i]
    l=left[x][y]
    if l!=0:
      S.add(i)
      rmv[min(m,i+l)].append(i)
      r=right[x][y]
      ans+=S.query(max(0,i-r+1),i+1)
    else:
      S.remove_all()


for i in range(1,h):
  xy=[]
  x,y=i,w-1
  while 0<=y<w and 0<=x<h:
    xy.append((x,y))
    x+=1
    y-=1
  m=len(xy)
  S=ordered_set(m)
  rmv=[[] for i in range(m+1)]
  for i in range(m):
    for j in rmv[i]:
      S.remove(j)
    x,y=xy[i]
    l=left[x][y]
    if l!=0:
      S.add(i)
      rmv[min(m,i+l)].append(i)
      r=right[x][y]
      ans+=S.query(max(0,i-r),i+1)
    else:
      S.remove_all()
      
print(ans)