You are given a *n* × *m* field consisting only of periods ('.') and asterisks ('*'). Your task is to count all right triangles with two sides parallel to the square sides, whose vertices are in the centers of '*'-cells. A right triangle is a triangle in which one angle is a right angle (that is, a 90 degree angle).
The first line contains two positive integer numbers *n* and *m* (1 ≤ *n*, *m* ≤ 1000). The following *n* lines consist of *m* characters each, describing the field. Only '.' and '*' are allowed.
n,m=list(int(i) for i in input().split())
A=[[0 for i in range(m)]for j in range(n)]
for i in range(n):
    x=input()
    for j in range(m):
        A[i][j]=x[j]
row=[0 for i in range(n)]
column=[0 for i in range(m)]
for i in range(n):
    sum=0
    for j in range(m):
        if A[i][j]=="*":
            sum+=1
    row[i]=sum
for i in range(m):
    sum=0
    for j in range(n):
        if A[j][i]=="*":
            sum+=1
    column[i]=sum
ans=0
for i in range(n):
    for j in range(m):
        if A[i][j]=="*":
            ans+=(row[i]-1)*(column[j]-1)
print(ans)
