def check(field, i, j):
    try:
        return field[i][j] == '#'
    except:
        return False


h, w = map(int, input().split())
field = [input() for _ in range(h)]
ans = 0
for i in range(h):
    for j in range(w):
        if field[i][j] == '.':
            continue
        d = max(i + j, h - i + j - 1, i + w - j - 1, h - i + w - j - 2)
        for k in range(2, d + 1, 2):
            coe = set()
            ti = i - k
            ui = i + k
            for l in range(1, k + 1):
                ci = ti + l
                cj = j + l
                if 0 <= ci < h and 0 <= cj < w and field[ci][cj] == '#':
                    for di, dj in coe:
                        if abs(ci - di) + abs(cj - dj) == k:
                            ans += 1
                    coe.add((ci, cj))
                ci = ui - l + 1
                cj = j + l - 1
                if 0 <= ci < h and 0 <= cj < w and field[ci][cj] == '#':
                    for di, dj in coe:
                        if abs(ci - di) + abs(cj - dj) == k:
                            ans += 1
                    coe.add((ci, cj))
print(ans)
