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 dx4[] = {-1, 0, 1, 0};
int dy4[] = {0, 1, 0, -1};
int dx8[] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
void Duxar(int _this_line) {}
bool AreEqual(double a, double b) { return (fabs(a - b) < 1e-10); }
template <class T>
void ReadNo(T &_value) {
  T _sign = 1;
  char ch;
  _value = 0;
  while (!isdigit(ch = getchar())) {
    ch == '-' ? _sign = -1 : _sign = 1;
  }
  do {
    _value = _value * 10 + (ch - '0');
  } while (isdigit(ch = getchar()));
  _value *= _sign;
}
template <class T>
void WriteNo(T _value, char _ch = ' ') {
  cout << _value << _ch;
}
long long ans;
int N, M;
char matchars[3000][3001];
vector<vector<int> > dpleft, dpright, dpleftdown;
vector<deque<int> > diagonal;
vector<int> bit;
int QueryBIT(vector<int> &bit, int pos) {
  int ans = 0;
  for (; pos; pos ^= ((pos & (pos - 1)) ^ pos)) {
    ans += bit[pos];
  }
  return ans;
}
void UpdateBIT(vector<int> &bit, int N, int pos, int val) {
  for (; pos <= N; pos += ((pos & (pos - 1)) ^ pos)) {
    bit[pos] += val;
  }
}
void SolveFromXY(int x, int y) {
  fill((bit).begin(), (bit).end(), 0);
  int k = 1;
  while (x < N && y >= 0) {
    if (dpright[x][y] > 1) {
      ans += QueryBIT(bit, k) - QueryBIT(bit, max(0, k - dpright[x][y]));
    }
    if (dpleft[x][y] > 1) {
      UpdateBIT(bit, 1 + N, k, 1);
      diagonal[k + min(dpleft[x][y], dpleftdown[x][y]) - 1].push_back(k);
    }
    while (diagonal[k].size()) {
      int pos = diagonal[k].front();
      diagonal[k].pop_front();
      UpdateBIT(bit, 1 + N, pos, -1);
    }
    ++k;
    ++x;
    --y;
  }
}
int main() {
  string fileInput = "sum";
  ios_base::sync_with_stdio(false);
  int i, j;
  cin >> N >> M;
  for (i = 0; i < N; ++i) {
    cin >> matchars[i];
  }
  dpleft.resize(N, vector<int>(M));
  dpright.resize(N, vector<int>(M));
  dpleftdown.resize(N, vector<int>(M));
  bit.resize(N + 1);
  diagonal.resize(1 + N);
  for (i = 0; i < N; ++i) {
    ans += (matchars[i][0] == 'z');
    dpleft[i][0] = (matchars[i][0] == 'z');
    dpright[i][M - 1] = (matchars[i][M - 1] == 'z');
    for (j = 1; j < M; ++j) {
      if (matchars[i][j] == 'z') {
        ++ans;
        dpleft[i][j] = 1 + dpleft[i][j - 1];
      }
      if (matchars[i][M - j - 1] == 'z') {
        dpright[i][M - j - 1] = 1 + dpright[i][M - j];
      }
    }
  }
  for (i = 0; i < N; ++i) {
    int x = i, y = 0;
    dpleftdown[x][y] = ('z' == matchars[x][y]);
    --x;
    ++y;
    while (x >= 0 && y < M) {
      if (matchars[x][y] == 'z') {
        dpleftdown[x][y] = 1 + dpleftdown[x + 1][y - 1];
      }
      --x;
      ++y;
    }
  }
  for (j = 1; j < M; ++j) {
    int x = N - 1, y = j;
    dpleftdown[x][y] = ('z' == matchars[x][y]);
    --x;
    ++y;
    while (x >= 0 && y < M) {
      if (matchars[x][y] == 'z') {
        dpleftdown[x][y] = 1 + dpleftdown[x + 1][y - 1];
      }
      --x;
      ++y;
    }
  }
  for (j = 0; j < M; ++j) {
    SolveFromXY(0, j);
  }
  for (i = 1; i < N; ++i) {
    SolveFromXY(i, M - 1);
  }
  WriteNo(ans, '\n');
  return 0;
}
