#include <bits/stdc++.h>
using namespace std;
int n, m, i, j;
char mat[3014][3014];
int w[3014][3014], e[3014][3014];
int sw[3014][3014];
vector<pair<int, int> > event;
int aib[3014];
long long ans;
int zrs(int x) { return (x ^ (x - 1)) & x; }
void add(int x, int v) {
  while (x <= n) {
    aib[x] += v;
    x += zrs(x);
  }
}
int sum(int x) {
  int ans = 0;
  while (x > 0) {
    ans += aib[x];
    x -= zrs(x);
  }
  return ans;
}
void solve(int x, int y) {
  int i, pos, xx, yy;
  event.clear();
  pos = 0;
  memset(aib, 0, sizeof(aib));
  xx = x;
  yy = y;
  for (i = 1; x <= n && y > 0; i++, x++, y--) {
    if (mat[x][y] != 'z') continue;
    event.push_back(make_pair(i + min(w[x][y], sw[x][y]), i));
  }
  x = xx;
  y = yy;
  sort(event.begin(), event.end());
  for (i = 1; x <= n && y > 0; i++, x++, y--) {
    while (pos < event.size()) {
      if (event[pos].first > i) break;
      add(event[pos++].second, -1);
    }
    if (mat[x][y] != 'z') continue;
    add(i, +1);
    ans += sum(i) - sum(i - e[x][y]);
  }
}
int main() {
  scanf("%d%d\n", &n, &m);
  for (i = 1; i <= n; i++) scanf("%s\n", mat[i] + 1);
  for (i = n; i > 0; i--) {
    for (j = 1; j <= m; j++) w[i][j] = (mat[i][j] == 'z' ? 1 + w[i][j - 1] : 0);
    for (j = m; j > 0; j--) e[i][j] = (mat[i][j] == 'z' ? 1 + e[i][j + 1] : 0);
    for (j = 1; j <= m; j++)
      sw[i][j] = (mat[i][j] == 'z' ? 1 + sw[i + 1][j - 1] : 0);
  }
  for (i = 1; i <= m; i++) solve(1, i);
  for (i = 2; i <= n; i++) solve(i, m);
  printf("%lld", ans);
  return 0;
}
