#include <bits/stdc++.h>
using namespace std;
int n, m;
char mp[3005][3005];
int l[3005][3005], r[3005][3005], d[3005][3005];
int a[6005][3005];
vector<pair<int, int> > v[3005];
void init() {
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (mp[i][j] == 'z')
        l[i][j] = l[i][j - 1] + 1;
      else
        l[i][j] = 0;
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = m; j >= 1; --j) {
      if (mp[i][j] == 'z')
        r[i][j] = r[i][j + 1] + 1;
      else
        r[i][j] = 0;
    }
  }
  for (int i = n; i >= 1; --i) {
    for (int j = 1; j <= m; ++j) {
      if (mp[i][j] == 'z')
        d[i][j] = d[i + 1][j - 1] + 1;
      else
        d[i][j] = 0;
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (mp[i][j] == 'z') v[j + r[i][j] - 1].push_back(make_pair(i, j));
    }
  }
}
void add(int p, int x, int v) {
  while (x <= n) {
    a[p][x] += v;
    x += x & (-x);
  }
}
int get(int p, int x) {
  int res = 0;
  while (x) {
    res += a[p][x];
    x -= x & (-x);
  }
  return res;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%s", mp[i] + 1);
  init();
  long long ans = 0;
  for (int j = m; j >= 1; --j) {
    for (int i = 0; i < (int)v[j].size(); ++i) {
      add(v[j][i].first + v[j][i].second - 1, v[j][i].first, 1);
    }
    for (int i = n; i >= 1; --i)
      if (mp[i][j] == 'z') {
        int x = min(l[i][j], d[i][j]);
        ans += get(i + j - 1, i + x - 1) - get(i + j - 1, i - 1);
      }
  }
  printf("%lld\n", ans);
  return 0;
}
