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.

<image>

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.

Input

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.

Output

Print the only integer a — the number of ''Z-pattern"s in Zeydabad.

Examples

Input

4 4
zzzz
zzz.
.z..
zzzz


Output

16


Input

1 4
z.z.


Output

2


Input

2 2
zz
zz


Output

5
#include <bits/stdc++.h>
inline long long read() {
  char c = getchar();
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  long long k = 0, kk = 1;
  if (c == '-') c = getchar(), kk = -1;
  while (c >= '0' && c <= '9') k = k * 10 + c - '0', c = getchar();
  return kk * k;
}
using namespace std;
void write(long long x) {
  if (x < 0) x = -x, putchar('-');
  if (x / 10) write(x / 10);
  putchar(x % 10 + '0');
}
void writeln(long long x) {
  write(x);
  puts("");
}
int n, m, lazy[10000010], ll[10000010], rr[10000010], kk, l[3010][3010],
    r[3010][3010], f[3010][3010];
char s[3010][3010];
long long ans;
void putit(int &d, int dd, int ddd, int x, int y, int l, int r) {
  if (!d) {
    d = ++kk;
    lazy[d] = lazy[dd] + ddd;
    ll[kk] = rr[kk] = 0;
  }
  if (x <= l && y >= r) {
    lazy[d]++;
    ll[d] = ll[dd];
    rr[d] = rr[dd];
    return;
  }
  if (y < l || x > r) {
    ll[d] = ll[dd];
    rr[d] = rr[dd];
    return;
  }
  int m = (l + r) >> 1;
  putit(ll[d], ll[dd], lazy[d], x, y, l, m);
  putit(rr[d], rr[dd], lazy[d], x, y, m + 1, r);
  lazy[d] = 0;
}
int findit(int d, int dd, int x, int l, int r) {
  if (l == r) return lazy[d] - lazy[dd];
  if (d == dd) return 0;
  int m = (l + r) >> 1;
  if (x <= m)
    return lazy[d] - lazy[dd] + findit(ll[d], ll[dd], x, l, m);
  else
    return lazy[d] - lazy[dd] + findit(rr[d], rr[dd], x, m + 1, r);
}
signed main() {
  n = read();
  m = read();
  for (int i = 1; i <= n; i++) {
    scanf("%s", s[i] + 1);
    for (int j = 1; j <= m; j++)
      if (s[i][j - 1] == 'z' && s[i][j] == 'z')
        l[i][j] = l[i][j - 1] + 1;
      else
        l[i][j] = s[i][j] == 'z';
    for (int j = m; j >= 1; j--)
      if (s[i][j + 1] == 'z' && s[i][j] == 'z')
        r[i][j] = r[i][j + 1] + 1;
      else
        r[i][j] = s[i][j] == 'z';
  }
  for (int dd = 1; dd <= m; dd++) {
    int xx = 1, yy = dd, x = 1, y = dd;
    kk = 0;
    while (xx >= 1 && xx <= n && yy >= 1 && yy <= m) {
      if (s[xx][yy] != 'z') {
        xx++;
        yy--;
        x = xx;
        y = yy;
        continue;
      }
      int delta = min(r[xx][yy], xx - x + 1);
      if (x == xx)
        putit(f[xx][yy], 0, 0, xx, xx + l[xx][yy] - 1, 1, n);
      else
        putit(f[xx][yy], f[xx - 1][yy + 1], 0, xx, xx + l[xx][yy] - 1, 1, n);
      ans += findit(f[xx][yy], f[xx - delta][yy + delta], xx, 1, n);
      xx++;
      yy--;
    }
  }
  for (int dd = 2; dd <= n; dd++) {
    int xx = dd, yy = m, x = dd, y = m;
    kk = 0;
    while (xx >= 1 && xx <= n && yy >= 1 && yy <= m) {
      if (s[xx][yy] != 'z') {
        xx++;
        yy--;
        x = xx;
        y = yy;
        continue;
      }
      int delta = min(r[xx][yy], xx - x + 1);
      if (x == xx)
        putit(f[xx][yy], 0, 0, xx, xx + l[xx][yy] - 1, 1, n);
      else
        putit(f[xx][yy], f[xx - 1][yy + 1], 0, xx, xx + l[xx][yy] - 1, 1, n);
      ans += findit(f[xx][yy], f[xx - delta][yy + delta], xx, 1, n);
      xx++;
      yy--;
    }
  }
  writeln(ans);
}
