H, W = map(int, input().split())
X = [[[0, 1][a=="#"] for a in input()] for i in range(H)]
def r(X):
    Y = [[0 for x in range(len(X))] for xx in range(len(X[0]))]
    for i in range(len(X[0])):
        for j in range(len(X)):
            # print(i,j)
            Y[i][j] = X[len(X)-j-1][i]
    return Y
    
    
c = 0
for t in range(4):
    X = r(X)
    for i in range(len(X)):
        for j in range(len(X[0])):
            if X[i][j] > 0:
                for n in range(1, min(i+1, len(X[0])-j)):
                    if i-n >= 0 and i-n < len(X) and j+n >= 0 and j+n < len(X[0]):
                        if X[i-n][j+n] > 0:
                            for m in range(n):
                                if i-n-m >= 0 and i-n-m < len(X) and j-n+m >= 0 and j-n+m < len(X[0]):
                                    if X[i-n-m][j-n+m] > 0:
                                        #print (i,j,n,m, "get1")
                                        c += 1
print (c)
