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 Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0] * (n + 1)
 
    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s
 
    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i

class ordered_set:
  def __init__(self,size):
    self.size=size
    self.bit=Bit(size+1)
    self.now=[0]*size
    self.tmp=[]
    
  def add(self,x):
    self.bit.add(x+1,1)
    self.tmp.append(x)
    self.now[x]=1
  
  def remove(self,x):
    if self.now[x]==1:
      self.bit.add(x+1,-1)
      self.now[x]=0
  
  def query(self,l,r):
    return self.bit.sum(r)-self.bit.sum(max(0,l))
  
  def remove_all(self):
    for x in self.tmp:
      self.remove(x)
    self.tmp=[]
    

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+1),i+1)
    else:
      S.remove_all()
      
print(ans)