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;
template <typename T>
inline bool upmin(T &x, T y) {
  return y < x ? x = y, 1 : 0;
}
template <typename T>
inline bool upmax(T &x, T y) {
  return x < y ? x = y, 1 : 0;
}
const long double eps = 1e-11;
const long double pi = acos(-1);
const int oo = 1 << 30;
const long long loo = 1ll << 62;
const int mods = 1e9 + 7;
const int MAXN = 3005;
const int INF = 0x3f3f3f3f;
inline int read() {
  int f = 1, x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 3) + (x << 1) + (c ^ 48);
    c = getchar();
  }
  return x * f;
}
char st[MAXN];
vector<pair<int, int> > V[MAXN << 2];
int a[MAXN][MAXN], l[MAXN][MAXN], r[MAXN][MAXN], cnt[MAXN << 2], C[MAXN << 2];
int nodenum = 0, ls[MAXN << 6], rs[MAXN << 6], s[MAXN << 6], rt[MAXN << 2];
int update(int x, int l, int r, int y) {
  int p = ++nodenum;
  ls[p] = ls[x], rs[p] = rs[x], s[p] = s[x] + 1;
  if (l == r) return p;
  int mid = (l + r) >> 1;
  if (y <= mid)
    ls[p] = update(ls[x], l, mid, y);
  else
    rs[p] = update(rs[x], mid + 1, r, y);
  return p;
}
int query(int x, int y, int l, int r, int z) {
  if (!x) return 0;
  if (l >= z) return s[x] - s[y];
  int mid = (l + r) >> 1;
  if (z > mid)
    return query(rs[x], rs[y], mid + 1, r, z);
  else
    return query(ls[x], ls[y], l, mid, z) + query(rs[x], rs[y], mid + 1, r, z);
}
signed main() {
  int n = read(), m = read();
  for (int i = 1; i <= n; i++) {
    scanf("%s", st + 1);
    for (int j = 1; j <= m; j++)
      a[i][j] = (st[j] == 'z'), V[i + j].push_back(make_pair(i, j));
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) l[i][j] = (!a[i][j] ? 0 : l[i][j - 1] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = m; j >= 1; j--) r[i][j] = (!a[i][j] ? 0 : r[i][j + 1] + 1);
  long long ans = 0;
  for (int i = 2; i <= n + m; i++) {
    int num = 0;
    for (int j = 0; j < V[i].size(); j++)
      if (a[V[i][j].first][V[i][j].second]) {
        pair<int, int> v = V[i][j];
        num++;
        rt[num] = update(rt[num - 1], 1, n + m, l[v.first][v.second] + num);
        ans += query(rt[num], rt[max(num - r[v.first][v.second], 0)], 1, n + m,
                     num + 1);
      } else {
        for (int i = 1; i <= num; i++) rt[i] = 0;
        num = nodenum = 0;
      }
    for (int i = 1; i <= num; i++) rt[i] = 0;
    nodenum = 0;
  }
  printf("%lld\n", ans);
  return 0;
}
