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;
int n, m, L[3009][3009], R[3009][3009], seg[3009 * 4], qi;
long long Ans;
pair<int, int> b[6009];
string s[3009];
vector<pair<int, int>> a;
struct st {
  int l, r, x;
} q[3009];
void EqualOne() {
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      ans += (s[i][j] == 'z');
    }
  }
  cout << ans << endl;
}
void dpLR() {
  int lz, rz;
  for (int i = 1; i <= n; i++) {
    lz = rz = 0;
    for (int j = 1; j <= m; j++) {
      L[i][j] = lz;
      if (s[i][j] == 'z')
        lz++;
      else
        lz = 0;
    }
    for (int j = m; j >= 1; j--) {
      R[i][j] = rz;
      if (s[i][j] == 'z')
        rz++;
      else
        rz = 0;
    }
  }
}
void update(int p, int l, int r, int idx) {
  if (r < idx || l > idx) return;
  if (l == r) {
    seg[p] = 1;
    return;
  }
  int mid = (l + r) / 2;
  update(p * 2, l, mid, idx);
  update(p * 2 + 1, mid + 1, r, idx);
  seg[p] = seg[p * 2] + seg[p * 2 + 1];
}
int qu(int p, int l, int r, int f, int t) {
  if (l > t || r < f) return 0;
  if (l >= f && r <= t) return seg[p];
  int mid = (l + r) / 2;
  return qu(p * 2, l, mid, f, t) + qu(p * 2 + 1, mid + 1, r, f, t);
}
bool cmp1(pair<int, int> a, pair<int, int> b) { return a.first < b.first; }
bool cmp2(st a, st b) { return a.x < b.x; }
void solveQuery() {
  int na = a.size();
  sort(b, b + na, cmp1);
  sort(q, q + qi, cmp2);
  int j = 0;
  for (int i = 0; i < qi; i++) {
    while (b[j].first <= q[i].x && j < na)
      update(1, 0, na - 1, b[j].second), j++;
    Ans += 1ll * qu(1, 0, na - 1, q[i].l, q[i].r);
  }
}
void subsolve() {
  int r, l, lastZ = 0;
  qi = 0;
  memset(seg, 0, sizeof seg);
  for (int i = 0; i < a.size(); i++) {
    if (s[a[i].first][a[i].second] == 'z') {
      r = R[a[i].first][a[i].second];
      b[i].first = max(a[i].first - r, 1);
      l = L[a[i].first][a[i].second];
      q[qi++] = {max(i - l, lastZ), i, a[i].first};
    } else
      lastZ = i + 1, b[i].first = 0;
    b[i].second = i;
  }
  solveQuery();
}
void d(int i, int j) {
  a.clear();
  while (i <= n && j >= 1) {
    a.push_back({i, j});
    i++, j--;
  }
  reverse(a.begin(), a.end());
  subsolve();
}
void allDiagrams() {
  for (int i = 1; i <= m; i++) d(1, i);
  for (int i = 2; i <= n; i++) d(i, m);
}
int main() {
  ios::sync_with_stdio(NULL);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    s[i] = " " + s[i];
  }
  if (n == 1 || m == 1) {
    EqualOne();
    return 0;
  }
  dpLR();
  allDiagrams();
  cout << Ans << endl;
}
