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 = map(int, input().split())
grid = [input() for _ in range(n)]
a = [[0 for _ in range(m)] for i in range(n)]
b = [[0 for _ in range(m)] for i in range(n)]
for i in range(n):
    for j in range(m):
        a[i][j] = a[i][j - 1] + (grid[i][j] == '*')
        if i:
            b[i][j] = b[i - 1][j]
        b[i][j] += grid[i][j] == '*'
ans = 0
for i in range(n):
    for j in range(m):
        if grid[i][j] == '*':
            l = r = u = d = 0
            if j:
                l = a[i][j - 1]
            r = a[i][-1] - a[i][j]
            if i:
                u = b[i - 1][j]
            d = b[-1][j] - b[i][j]
            ans += (l + r) * (u + d)
print(ans)