

def distance(a,b):
	return abs(a[0]-b[0])+abs(a[1]-b[1])


n=0

H,W=input().split()
r=[]
for i in range(H):
	r.append(input().split())
stones=[]
for i in range(H):
	for j in range(W):
		if(r[i][j]=="#"):
			stones.append([j,i])

for i in range(len(stones)):
	for j in range(i,(len(stones)):
		d=distance(stones[i],stones[j])
		for k in range(j,len(stones)):
			if(distance(stones[i],stones[k])==distance(stones[j],stones[k])==d):
				n+=1
print(n)				







