

H,W = map(int,raw_input().split())

s = []
for i in range(H):
    s.append(map(int,raw_input().split()))

count=0
for i in range(H):
    for j in range(W):
        if s[i][j]=='#':
            k=1
            while i-k>=0 and i+k<=H-1 and j+k<=W-1:
                if s[i-k][j+k]=='#' and s[i+k][j+k]=="#":
                    count+=1
                k+=1
            k=1
            while i+k<=H-1 and j-k>=0 and j+k<=W-1:
                if s[i+k][j-k]=='#' and s[i+k][j+k]=="#":
                    count+=1
                k+=1


print count