A tourist wants to visit country Zeydabad for Zbazi (a local game in Zeydabad).

The country Zeydabad is a rectangular table consisting of *n* rows and *m* columns. Each cell on the country is either 'z' or '.'.

The tourist knows this country is named Zeydabad because there are lots of ''Z-pattern"s in the country. A ''Z-pattern" is a square which anti-diagonal is completely filled with 'z' and its upper and lower rows are also completely filled with 'z'. All other cells of a square can be arbitrary.

Note that a ''Z-pattern" can consist of only one cell (see the examples).

So he wants to count the number of ''Z-pattern"s in the country (a necessary skill for Zbazi).

Now your task is to help tourist with counting number of ''Z-pattern"s.

As input/output can reach huge size it is recommended to use fast input/output methods: for example, prefer to use gets/scanf/printf instead of getline/cin/cout in C++, prefer to use BufferedReader/PrintWriter instead of Scanner/System.out in Java.
The first line contains two integers *n*, *m* (1 ≤ *n*, *m* ≤ 3000) — the number of rows and columns respectively.

Each of the next *n* lines contains *m* characters 'z' or '.' — the description of Zeydabad.
none
4 4
zzzz
zzz.
.z..
zzzz
16
1 4
z.z.
2
2 2
zz
zz
5
import sys
input = sys.stdin.buffer.readline

def make_tree(n):
    tree1 = [0] * (n + 1)
    tree2 = [0] * (n + 1)
    return tree1, tree2

def add(i, x, tree):
    while i <= c:
        tree[i] += x
        i += i & -i

def add_segment(l, r, x):
    add(l, -x * (l - 1), tree1)
    add(r + 1, x * r, tree1)
    add(l, x, tree2)
    add(r + 1, -x, tree2)

def get_sum(i, tree):
    s = 0
    while i > 0:
        s += tree[i]
        i -= i & -i
    return s

def get_sum_segment(s, t):
    s -= 1
    x = get_sum(s, tree1) + get_sum(s, tree2) * s
    y = get_sum(t, tree1) + get_sum(t, tree2) * t
    return y - x

n, m = map(int, input().split())
l = [[] for _ in range(n + m)]
r = [[] for _ in range(n + m)]
for i in range(n):
    s = list(input().rstrip())
    l0, r0 = [0] * m, [0] * m
    c = 0
    for j in range(m):
        if s[j] == 122:
            c += 1
        else:
            c = 0
        l0[j] = c
    c = 0
    for j in range(m - 1, -1, -1):
        if s[j] == 122:
            c += 1
        else:
            c = 0
        r0[j] = c
    for j in range(m):
        l[i + j].append(l0[j])
        r[i + j].append(r0[j])
for i in range(n + m):
    l[i].append(0)
    r[i].append(0)
ans = 0
for i in range(n + m):
    l0, r0 = l[i], r[i]
    li, ri = [], []
    for u, v in zip(l0, r0):
        if not u + v and li:
            c = len(li)
            x = [[] for _ in range(c + 1)]
            k = 0
            for j in range(c - 1, -1, -1):
                x[max(0, c - ri[j] - k)].append(c - j)
                k += 1
            tree1, tree2 = make_tree(c)
            for j in range(c - 1, -1, -1):
                t = c - j
                s = max(1, t - li[j] + 1)
                add_segment(s, t, 1)
                for k in x[j]:
                    ans += get_sum_segment(k, k)
            li, ri = [], []
        elif u + v:
            li.append(u)
            ri.append(v)
print(ans)