#include <bits/stdc++.h>
using namespace std;
const int N = 3010;
char s[N][N];
int n, m, l[N][N], r[N][N], d[N][N];
int bit[2 * N][N];
struct node {
  int x, y;
  node(int xi, int yi) : x(xi), y(yi) {}
};
vector<node> vec[N];
void init() {
  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;
      else
        l[i][j] = 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = m; j >= 1; j--) {
      if (s[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 (s[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 (s[i][j] == 'z') {
        vec[j + r[i][j] - 1].push_back(node(i, j));
      }
  }
}
void add(int a, int b, int num) {
  while (b <= m) {
    bit[a][b] += num;
    b += b & -b;
  }
}
int sum(int a, int b) {
  int ans = 0;
  while (b >= 1) {
    ans += bit[a][b];
    b -= b & -b;
  }
  return ans;
}
long long solve() {
  long long ans = 0;
  for (int i = m; i >= 1; i--) {
    for (int j = 0; j < vec[i].size(); j++) {
      int xi = vec[i][j].x, yi = vec[i][j].y;
      add(xi + yi, yi, 1);
    }
    for (int j = 1; j <= n; j++) {
      if (s[j][i] != 'z') continue;
      int c = min(l[j][i], d[j][i]);
      ans += (long long)sum(i + j, i) - sum(i + j, i - c);
    }
  }
  return ans;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s[i] + 1);
  }
  init();
  printf("%I64d\n", solve());
  return 0;
}
