#include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 3;
long long n, m, ans;
bitset<N> row[N], dia[N], a[N];
string s;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> s;
    for (int j = 0; j < m; j++)
      if (s[m - 1 - j] == 'z') {
        row[i][j] = a[i][j] = dia[i][j] = 1;
        ans++;
      }
  }
  for (int x = 1; x < min(n, m); x++) {
    for (int i = 0; i < n; i++) row[i] &= a[i] >> x;
    for (int i = x; i < n; i++) dia[i - x] &= a[i] >> x;
    for (int i = x; i < n; i++)
      ans += (row[i - x] & dia[i - x] & row[i]).count();
  }
  cout << ans << endl;
}
