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")
using namespace std;
template <class T>
ostream& operator<<(ostream& os, vector<T> V) {
  os << "[ ";
  for (auto v : V) os << v << " ";
  return os << "]";
}
template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> P) {
  return os << "(" << P.first << "," << P.second << ")";
}
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const long long INF = 0x3f3f3f3f;
const long long M = 1e9 + 7;
const long long N = 3e3 + 5;
long long n, m;
bool g[N][N];
long long ld[N][N], rd[N][N];
long long dd[2 * N][N];
vector<long long> mst[4 * N];
void build(long long s, long long v, long long l, long long r) {
  if (r - l == 1)
    mst[v] = {rd[l][s - l] - l};
  else {
    long long m = (l + r) / 2;
    build(s, v * 2, l, m);
    build(s, v * 2 + 1, m, r);
    mst[v].clear();
    mst[v].reserve((long long)(mst[v * 2]).size() +
                   (long long)(mst[v * 2 + 1]).size());
    merge((mst[v * 2]).begin(), (mst[v * 2]).end(), (mst[v * 2 + 1]).begin(),
          (mst[v * 2 + 1]).end(), back_inserter(mst[v]));
  }
}
long long query(long long v, long long l, long long r, long long ql,
                long long qr, long long x) {
  if (l >= qr || r <= ql)
    return 0;
  else if (l >= ql && r <= qr)
    return mst[v].end() - upper_bound((mst[v]).begin(), (mst[v]).end(), x);
  else {
    long long m = (l + r) / 2;
    return query(v * 2, l, m, ql, qr, x) + query(v * 2 + 1, m, r, ql, qr, x);
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << fixed << setprecision(15);
  cin >> n >> m;
  for (long long i = 0; i < n; ++i) {
    string s;
    cin >> s;
    for (long long j = 0; j < m; ++j) g[i][j] = s[j] == 'z';
  }
  for (long long i = 0; i < n; ++i) {
    long long c = 0;
    for (long long j = 0; j < m; ++j) {
      if (g[i][j])
        ld[i][j] = ++c;
      else
        c = 0;
    }
    c = 0;
    for (long long j = m - 1; j >= 0; --j) {
      if (g[i][j])
        rd[i][j] = ++c;
      else
        c = 0;
    }
  }
  for (long long s = 0; s < n + m - 1; ++s) {
    long long c = 0;
    for (long long i = min(s, n - 1); i >= 0; --i) {
      if (g[i][s - i])
        dd[i][s - i] = ++c;
      else
        c = 0;
    }
  }
  long long ans = 0;
  for (long long s = 0; s < n + m - 1; ++s) {
    long long rb = max(0LL, s - m + 1);
    long long re = min(n, s + 1);
    build(s, 1, rb, re);
    for (long long i = rb; i < re; ++i) {
      long long j = s - i;
      ans += query(1, rb, re, i, i + min(dd[i][j], ld[i][j]), -i);
    }
  }
  cout << ans << '\n';
}
