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>
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#pragma GCC target("avx,tune=native")
using namespace std;
namespace fastio {
char in[100000];
int itr = 0, llen = 0;
char get() {
  if (itr == llen) llen = fread(in, 1, 100000, stdin), itr = 0;
  if (llen == 0) return EOF;
  return in[itr++];
}
char out[100000];
int itr2 = 0;
void put(char c) {
  out[itr2++] = c;
  if (itr2 == 100000) {
    fwrite(out, 1, 100000, stdout);
    itr2 = 0;
  }
}
int clear() {
  fwrite(out, 1, itr2, stdout);
  itr2 = 0;
  return 0;
}
int getint() {
  int ret = 0;
  char ch = get();
  while (ch < '0' || ch > '9') {
    ch = get();
    if (ch == '-') return -getint();
  }
  while ('0' <= ch && ch <= '9') {
    ret = ret * 10 - 48 + ch;
    ch = get();
  }
  return ret;
}
string getstr() {
  string ret = "";
  char ch = get();
  while (ch == ' ' || ch == '\n') ch = get();
  while (ch != ' ' && ch != '\n') ret.push_back(ch), ch = get();
  return ret;
}
void putstr(string s) {
  for (int i = 0; i < s.size(); i++) put(s[i]);
}
void putint(int x) {
  if (x < 0) {
    put('-');
    putint(-x);
    return;
  }
  if (x == 0) {
    put('0');
    return;
  }
  char c[40];
  int pos = 0;
  while (x) {
    c[pos++] = '0' + x % 10;
    x /= 10;
  }
  for (int i = pos - 1; i >= 0; i--) put(c[i]);
  put(' ');
}
void putln(int x) {
  if (x < 0) {
    put('-');
    putln(-x);
    return;
  }
  if (x == 0) {
    put('0');
    put('\n');
    return;
  }
  char c[40];
  int pos = 0;
  while (x) {
    c[pos++] = '0' + x % 10;
    x /= 10;
  }
  for (int i = pos - 1; i >= 0; i--) put(c[i]);
  put('\n');
}
}  // namespace fastio
using namespace fastio;
const int inf = 0x3f3f3f3f;
const double eps = 1e-6;
const int mod = 1000000007;
int n, m;
string s[3005];
bitset<3003> dif[6005], row[3005];
bitset<3003> f[2][3005], g[2][3005];
bitset<3003> Tmp;
int now, nxt;
void init(int x) {
  for (int i = 1; i <= m; i++) f[nxt][i] <<= 1, f[nxt][i].set(0);
  for (int i = 1; i <= m; i++) {
    f[now][i] = (f[nxt][i] & (dif[x - i + 3001] >> x));
  }
  for (int i = 1; i <= m; i++) g[nxt][i] <<= 1, g[nxt][i].set(0);
  for (int i = 1; i <= m; i++) {
    g[now][i] = g[nxt][i] & (row[x] >> i);
  }
}
int T[3003];
bitset<3003> dat[3003];
int solve(int x) {
  int ret = 0;
  int r = 0;
  for (int i = 1; i <= m; i++) {
    r = max(r, i);
    while (row[x][r]) r++;
    T[i] = r - i;
  }
  for (int i = 1; i <= m; i++) {
    ret += (f[now][i] & g[now][i] & dat[T[i]]).count();
  }
  now ^= 1;
  nxt ^= 1;
  return ret;
}
int main() {
  n = getint();
  m = getint();
  for (int i = 1; i <= n; i++) s[i] = " " + getstr();
  for (int i = 0; i <= 3000; i++)
    for (int j = 0; j <= i; j++) dat[i].set(j);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (s[i][j] == 'z') dif[i - j + 3001].set(i), row[i].set(j);
    }
  }
  long long ans = 0;
  now = 0;
  nxt = 1;
  for (int i = n; i >= 1; i--) {
    init(i);
    ans += solve(i);
  }
  cout << ans << endl;
  return 0;
}
