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;
const int N = 3010;
const int INF = 0x3f3f3f3f;
const int iinf = 1 << 30;
const long long linf = 2e18;
const int mod = 1000000007;
const double eps = 1e-7;
void douout(double x) { printf("%lf\n", x + 0.0000000001); }
template <class T>
void print(T a) {
  cout << a << endl;
  exit(0);
}
template <class T>
void chmin(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
void Tmin(T &a, T &b, T &c) {
  return min(a, min(b, c));
}
template <class T>
void Tmax(T &a, T &b, T &c) {
  return max(a, max(b, c));
}
void add(int &a, int b) { a = a + b < mod ? a + b : a + b - mod; }
void sub(int &a, int b) { a = (a - b + mod) % mod; }
void mul(int &a, int b) { a = (long long)a * b % mod; }
int addv(int a, int b) { return (a += b) >= mod ? a -= mod : a; }
int subv(int a, int b) { return (a -= b) < 0 ? a += mod : a; }
int mulv(int a, int b) { return (long long)a * b % mod; }
int read() {
  int f = 1, x = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int pw(int a, int b) {
  int s = 1;
  for (; b; b >>= 1, a = (long long)a * a % mod)
    if (b & 1) s = (long long)s * a % mod;
  return s;
}
int n, m;
string s;
char a[N][N];
vector<pair<int, int> > ed[N];
int bit[2 * N][N], le[N][N], ri[N][N], ledw[N][N];
void add(int x, int y, int v) {
  for (; y <= 3000; y += (y & -y)) bit[x][y] += v;
}
int qry(int x, int y) {
  int res = 0;
  for (; y; y -= (y & -y)) res += bit[x][y];
  return res;
}
signed main() {
  scanf("%d%d", &n, &m);
  for (int i = (1); i <= (n); i++) {
    cin >> s;
    for (int j = (1); j <= (m); j++) a[i][j] = s[j - 1];
  }
  for (int i = (1); i <= (n); i++) {
    for (int j = (1); j <= (m); j++) {
      if (a[i][j] != 'z')
        le[i][j] = 0;
      else
        le[i][j] = le[i][j - 1] + 1;
    }
    for (int j = (m); j >= (1); j--) {
      if (a[i][j] != 'z')
        ri[i][j] = 0;
      else
        ri[i][j] = ri[i][j + 1] + 1;
    }
    for (int j = (1); j <= (m); j++) {
      if (a[i][j] == 'z') ed[j + ri[i][j] - 1].push_back(make_pair(i, j));
    }
  }
  for (int i = (n); i >= (1); i--) {
    for (int j = (1); j <= (m); j++) {
      if (a[i][j] != 'z')
        ledw[i][j] = 0;
      else
        ledw[i][j] = ledw[i + 1][j - 1] + 1;
    }
  }
  long long ans = 0;
  for (int j = (m); j >= (1); j--) {
    int sz = ((int)ed[j].size());
    for (int i = (0); i <= (sz - 1); i++) {
      int x = ed[j][i].first, y = ed[j][i].second;
      add(x + y, y, 1);
    }
    for (int i = (1); i <= (n); i++) {
      if (a[i][j] != 'z') continue;
      int r = min(le[i][j], ledw[i][j]);
      ans += (long long)(qry(i + j, j) - qry(i + j, j - r));
    }
  }
  printf("%lld\n", ans);
  return 0;
}
