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>
using namespace std;
void fre() {
  freopen("c://test//input.in", "r", stdin);
  freopen("c://test//output.out", "w", stdout);
}
template <class T1, class T2>
inline void gmax(T1 &a, T2 b) {
  if (b > a) a = b;
}
template <class T1, class T2>
inline void gmin(T1 &a, T2 b) {
  if (b < a) a = b;
}
const int N = 3030, M = 0, Z = 1e9 + 7, ms63 = 0x3f3f3f3f;
int n, m;
char s[N][N];
bool e[N][N];
int lft[N][N];
int rgt[N][N];
int b[N * 2];
struct A {
  int l, r;
  int flag;
  int maxv;
  int num;
} a[N * 2 * 4];
void pushup(int o) {
  a[o].maxv = max(a[o << 1].maxv, a[o << 1 | 1].maxv);
  a[o].num = a[o << 1].num + a[o << 1 | 1].num;
}
void pushdown(int o) {
  a[o << 1].maxv += a[o].flag;
  a[o << 1].flag += a[o].flag;
  a[o << 1 | 1].maxv += a[o].flag;
  a[o << 1 | 1].flag += a[o].flag;
  a[o].flag = 0;
}
void build(int o, int l, int r) {
  a[o].l = l;
  a[o].r = r;
  a[o].flag = 0;
  if (l == r) {
    if (b[l] >= 0) {
      a[o].maxv = -1e9;
      a[o].num = 1;
    } else {
      a[o].maxv = b[l];
      a[o].num = 0;
    }
    return;
  }
  int mid = (l + r) >> 1;
  build(o << 1, l, mid);
  build(o << 1 | 1, mid + 1, r);
  pushup(o);
};
void update(int o) {
  if (a[o].l == a[o].r) {
    a[o].num = 1;
    a[o].flag = 0;
    a[o].maxv = -1e9;
    return;
  }
  pushdown(o);
  if (a[o << 1].maxv == 0) update(o << 1);
  if (a[o << 1 | 1].maxv == 0) update(o << 1 | 1);
  pushup(o);
}
void add(int o, int l, int r) {
  if (a[o].l == l && a[o].r == r) {
    ++a[o].maxv;
    ++a[o].flag;
    if (a[o].maxv == 0) update(o);
    return;
  }
  pushdown(o);
  int mid = (a[o].l + a[o].r) >> 1;
  if (r <= mid)
    add(o << 1, l, r);
  else if (l > mid)
    add(o << 1 | 1, l, r);
  else {
    add(o << 1, l, mid);
    add(o << 1 | 1, mid + 1, r);
  }
  pushup(o);
}
int check(int o, int l, int r) {
  if (a[o].l == l && a[o].r == r) return a[o].num;
  pushdown(o);
  int mid = (a[o].l + a[o].r) >> 1;
  int val;
  if (r <= mid)
    return check(o << 1, l, r);
  else if (l > mid)
    return check(o << 1 | 1, l, r);
  else
    return check(o << 1, l, mid) + check(o << 1 | 1, mid + 1, r);
}
int main() {
  while (~scanf("%d%d", &n, &m)) {
    long long ans = 0;
    memset(e, 0, sizeof(e));
    memset(lft, 0, sizeof(lft));
    memset(rgt, 0, sizeof(rgt));
    for (int i = 1; i <= n; ++i) scanf("%s", s[i] + 1);
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= m; ++j) {
        if (s[i][j] == '.')
          lft[i][j] = 0;
        else
          lft[i][j] = lft[i][j - 1] + 1;
      }
      for (int j = m; j >= 1; --j) {
        if (s[i][j] == '.')
          rgt[i][j] = 0;
        else
          rgt[i][j] = rgt[i][j + 1] + 1;
      }
    }
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= m; ++j)
        if (s[i][j] == 'z' && e[i][j] == 0) {
          int y = i;
          int x = j;
          e[y][x] = 1;
          int o = 1;
          b[o] = rgt[y][x] - o;
          while (y < n && x > 1 && s[y + 1][x - 1] == 'z') {
            ++y;
            --x;
            e[y][x] = 1;
            ++o;
            b[o] = rgt[y][x] - o;
          }
          build(1, 1, o);
          for (int k = 1; k <= o; ++k) {
            ans += check(1, k, min(o, k + lft[i + k - 1][j - k + 1] - 1));
            add(1, k, o);
          }
        }
    }
    printf("%lld\n", ans);
  }
  return 0;
}
