import numpy as np
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True  and False
def ddprint(x):
  if DBG:
    print(x)


h,w = inm()
s = [ [] for i in range(h) ]
for i in range(h):
    ss = input()
    s[i] = [1 if ss[j]=='#' else 0 for j in range(w)]

b = np.ndarray(shape=(w+h+2,w+h+2), dtype=int)
accz = np.ndarray(shape=(w+h+2,w+h+2), dtype=int)
accu = np.ndarray(shape=(w+h+2,w+h+2), dtype=int)
for i in range(w+h+2):
    for j in range(w+h+2):
        b[i][j] = accz[i][j] = accu[i][j] = 0
#b = [ [0]*(w+h+2) for j in range(w+h+2) ]
#cnt = 1
for i in range(h):
    for j in range(w):
        b[i-j][i+j] = s[i][j]


#accz = [ [0]*(w+h+2) for j in range(w+h+2) ]
#accu = [ [0]*(w+h+2) for j in range(w+h+2) ]
for z in range(-w,h):
    for u in range(w+h-1):
        accz[z][u] = accz[z-1][u] + b[z][u]
        accu[z][u] = accu[z][u-1] + b[z][u]


sum = 0
for u in range(w+h):
    lft = -u if u<w else u-2*w+2
    rgt =  u if u<h else 2*h-u-2
    for z in range(lft, rgt+1):
        if b[z][u]==0:
            continue
        for zz in range(z+1,rgt+1):
            if b[zz][u]==0:
                continue
            uu = u - (zz-z)
            if uu>=0:
                lft2 = -uu if uu<w else uu-2*w+2
                rgt2 =  uu if uu<h else 2*h-uu-2
                z3 = min(zz,rgt2)
                z4 = max(z,lft2)-1
                sump = accz[z3][uu] - accz[z4][uu]
                sum += sump
            uu = u + (zz-z)
            if uu<=w+h:
                lft2 = -uu if uu<w else uu-2*w+2
                rgt2 =  uu if uu<h else 2*h-uu-2
                z3 = min(zz,rgt2)
                z4 = max(z,lft2)-1
                sump = accz[z3][uu] - accz[z4][uu]
                sum += sump

for z in range(-w+1,h):
    lo = abs(z)
    hi =  2*w+z-2 if z<h-w else 2*h-z-2
    for u in range(lo, hi+1):
        if b[z][u]==0:
            continue
        for uu in range(u+2,hi+1):
            if b[z][uu]==0:
                continue
            zz = z - (uu-u)
            if zz >= 1-w:
                lo2 = abs(zz)
                hi2 =  2*w+zz-2 if zz<h-w else 2*h-zz-2
                u3 = min(uu-1,hi2)
                u4 = max(u+1,lo2)-1
                sump = accu[zz][u3] - accu[zz][u4]
                sum += sump

            zz = z + (uu-u)
            if zz <= h-1:
                lo2 = abs(zz)
                hi2 =  2*w+zz-2 if zz<h-w else 2*h-zz-2
                u3 = min(uu-1,hi2)
                u4 = max(u+1,lo2)-1
                sump = accu[zz][u3] - accu[zz][u4]
                sum += sump

print(sum)
