#include <bits/stdc++.h>
using namespace std;
int T, n, m, bit[3100 * 2][3100], l[3100][3100];
int lr[3100][3100], r[3100][3100];
long long ans = 0;
struct node {
  int x, y;
};
vector<node> g[3100];
char s[3100][3100];
int sum(int i, int x) {
  int ans = 0;
  while (x > 0) {
    ans += bit[i][x];
    x -= x & -x;
  }
  return ans;
}
void add(int i, int x, int d) {
  while (x <= m) {
    bit[i][x] += d;
    x += x & -x;
  }
}
void pre() {
  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 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') {
        lr[i][j] = 0;
        continue;
      }
      if (j - 1 >= 1 && i + 1 <= n)
        lr[i][j] = lr[i + 1][j - 1] + 1;
      else
        lr[i][j] = 1;
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) g[j + r[i][j] - 1].push_back(node{i, j});
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  ans = 0;
  pre();
  for (int j = m; j >= 1; j--) {
    int len = g[j].size();
    for (int i = 0; i < len; i++) {
      int x = g[j][i].x, y = g[j][i].y;
      add(x + y, y, 1);
    }
    for (int i = 1; i <= n; i++) {
      if (s[i][j] != 'z') continue;
      int len = min(l[i][j], lr[i][j]);
      ans += sum(j + i, j) - sum(i + j, j - len);
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
