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.
matrix = []
points = []
n, m = map(int, input().split())
for row in [None] * n:
    matrix.append(list(input()))
    lm = len(matrix) - 1
    for i in range(m):
        if matrix[-1][i] == '*':
            points.append([lm, i])


count = 0
for [y, x] in points:
    cv = 0
    for i in range(n):
        if i == y:
            continue
        if matrix[i][x] == '*':
            cv += 1
    ch = 0
    for i in range(m):
        if i == x:
            continue
        if matrix[y][i] == '*':
            ch += 1
    count += cv * ch
print(count)
