#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000;
int n, m, l[3002][3002], r[3002][3002], ld[3001][3001];
char s[3002][3002];
int bit[6002][3001];
vector<pair<int, int> > v[6002];
void add(int x, int y) {
  for (int i = y; i <= 3000; i += (i & (-i))) {
    bit[x][i]++;
  }
}
int query(int num, int x) {
  int ans = 0;
  for (int i = x; i; i -= (i & (-i))) {
    ans += bit[num][i];
  }
  return ans;
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    scanf("%s", s[i] + 1);
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (s[i][j] == 'z') {
        l[i][j] = l[i][j - 1] + 1;
      }
    }
    for (int j = m; j >= 1; --j) {
      if (s[i][j] == 'z') {
        r[i][j] = r[i][j + 1] + 1;
      }
    }
  }
  for (int i = n; i >= 1; --i) {
    for (int j = 1; j <= m; ++j) {
      if (s[i][j] == 'z') {
        ld[i][j] = ld[i + 1][j - 1] + 1;
        v[j + r[i][j] - 1].push_back(make_pair(i, j));
      }
    }
  }
  long long res = 0;
  for (int j = m; j >= 1; --j) {
    int sz = v[j].size();
    for (int i = 0; i < sz; ++i) {
      int x = v[j][i].first;
      int y = v[j][i].second;
      add(x + y, y);
    }
    for (int i = 1; i <= n; ++i) {
      int r = min(ld[i][j], l[i][j]);
      res += query(i + j, j) - query(i + j, j - r);
    }
  }
  cout << res;
  return 0;
}
