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;
using lint = long long;
using pii = pair<int, int>;
using pll = pair<lint, lint>;
template <typename T>
using vc = vector<T>;
template <typename T>
using vvc = vector<vector<T>>;
template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
constexpr lint ten(int n) { return n == 0 ? 1 : ten(n - 1) * 10; }
template <class T>
class BinaryIndexedTree {
 private:
  int n;
  vector<T> bit;
  T _sum(int i) {
    T res = 0;
    while (i) {
      res += bit[i];
      i -= i & -i;
    }
    return res;
  }
  void _add(int i, T x) {
    while (i <= n) {
      bit[i] += x;
      i += i & -i;
    }
  }

 public:
  T sum(int i) { return _sum(i + 1); }
  void add(int i, T x) { _add(i + 1, x); }
  BinaryIndexedTree() : n(0) {}
  explicit BinaryIndexedTree(size_t _n, T _def = 0) : n(_n) {
    bit.resize(n + 1, _def);
  }
};
struct query {
  int col, type, val;
};
bool cmp(const query& q1, const query& q2) {
  if (q1.col != q2.col) return q1.col < q2.col;
  return q1.type < q2.type;
}
class EZbaziInZeydabad {
 public:
  void solve(std::istream& in, std::ostream& out) {
    ios_base::sync_with_stdio(false);
    in.tie(nullptr), out.tie(nullptr);
    int N, M;
    in >> N >> M;
    vc<string> grid(N);
    for (int i = (0); i < (N); ++i) in >> grid[i];
    vvc<int> left(N, vc<int>(M, 0));
    vvc<int> right(N, vc<int>(M, 0));
    vvc<int> diag(N, vc<int>(M, 0));
    for (int i = (0); i < (N); ++i)
      for (int j = (0); j < (M); ++j) {
        if (grid[i][j] == '.') continue;
        if (j == 0)
          left[i][j] = 1;
        else
          left[i][j] = left[i][j - 1] + 1;
      }
    for (int i = (0); i < (N); ++i)
      for (int j = M - 1; 0 <= j; --j) {
        if (grid[i][j] == '.') continue;
        if (j == M - 1)
          right[i][j] = 1;
        else
          right[i][j] = right[i][j + 1] + 1;
      }
    for (int i = (0); i < (N); ++i)
      for (int j = (0); j < (M); ++j) {
        if (grid[i][j] == '.') continue;
        if (not i or j == M - 1)
          diag[i][j] = 1;
        else
          diag[i][j] = diag[i - 1][j + 1] + 1;
      }
    lint ans = 0;
    for (int k = (0); k < (N + M - 1); ++k) {
      vc<query> qq;
      for (int j = (0); j < (M); ++j) {
        if (k - j >= N or j > k) continue;
        qq.push_back({j, 0, j});
        qq.push_back({min(right[k - j][j], diag[k - j][j]) + j, 1, j});
        qq.push_back({j, 2, 0});
      }
      sort((qq).begin(), (qq).end(), cmp);
      BinaryIndexedTree<int> bit(M);
      for (auto& q : qq) {
        if (q.type == 0)
          bit.add(q.val, 1);
        else if (q.type == 1)
          bit.add(q.val, -1);
        else
          ans += bit.sum(M - 1) - bit.sum(q.col - left[k - q.col][q.col]);
      }
    }
    out << ans << '\n';
  }
};
int main() {
  EZbaziInZeydabad solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
