def dist(i1, j1, i2, j2):
    return abs(i1-i2) + abs(j1 - j2)
H, W = map(int, input().split())
X = [[[0, 1][a=="#"] for a in input()] for i in range(H)]
Y = []
for i in range(H):
    for j in range(W):
        if X[i][j]:
            Y.append((i,j))

ans = 0
for i in range(len(Y)-2):
    for j in range(i+1, len(Y)-1):
        for k in range(j+1, len(Y)):
            if dist(Y[i][0], Y[i][1], Y[j][0], Y[j][1]) == dist(Y[i][0], Y[i][1], Y[k][0], Y[k][1]):
                if dist(Y[i][0], Y[i][1], Y[k][0], Y[k][1]) == dist(Y[k][0], Y[k][1], Y[j][0], Y[j][1]):
                    if dist(Y[k][0], Y[k][1], Y[j][0], Y[j][1]) == dist(Y[i][0], Y[i][1], Y[j][0], Y[j][1]):
                        ans += 1