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 = 3e3 + 5;
int get() {
  char c = getchar();
  while (c != '.' && c != 'z') c = getchar();
  return c == 'z';
}
int read() {
  int s = 0;
  char c = getchar(), lc = '+';
  while (c < '0' || '9' < c) lc = c, c = getchar();
  while ('0' <= c && c <= '9') s = s * 10 + c - '0', c = getchar();
  return lc == '-' ? -s : s;
}
void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x < 10)
    putchar(x + '0');
  else
    write(x / 10), putchar(x % 10 + '0');
}
void print(long long x = -1, char c = '\n') {
  write(x);
  putchar(c);
}
struct BIT {
  int t[N], n;
  void add(int x, int y) {
    x++;
    for (; x <= n; x += x & -x) t[x] += y;
  }
  int query(int x) {
    x++;
    int ret = 0;
    for (; x; x = x & (x - 1)) ret += t[x];
    return ret;
  }
} t;
long long ans;
int a[N][N], l[N][N], r[N][N];
priority_queue<pair<int, int>> q;
void clear() {
  while (!q.empty()) {
    t.add(q.top().second, -1);
    q.pop();
  }
}
signed main(signed Goodbye, char *Wangang[]) {
  (void)Goodbye, (void)Wangang;
  int n = read(), m = read();
  t.n = m + 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) a[i][j] = get();
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) l[i][j] = a[i][j] ? l[i][j - 1] + 1 : 0;
  for (int i = 1; i <= n; i++)
    for (int j = m; j >= 1; j--) r[i][j] = a[i][j] ? r[i][j + 1] + 1 : 0;
  for (int tx = 1; tx <= n; tx++)
    for (int ty = 1; ty <= m; ty++)
      if (tx == 1 || ty == m) {
        for (int x = tx, y = ty; x <= n && y >= 1; x++, y--)
          if (a[x][y]) {
            while (!q.empty() && q.top().first >= y) {
              t.add(q.top().second, -1);
              q.pop();
            }
            t.add(y, 1);
            q.push(make_pair(y - l[x][y], y));
            ans += t.query(y + r[x][y] - 1);
          } else
            clear();
        clear();
      }
  print(ans);
  return 0;
}
