#include <bits/stdc++.h>
using namespace std;
const long long M = 998244353;
const double PI = 2 * acos(0.0);
const long long oo = 1e9 + 100;
const string DIGITS = "0123456789";
const string ALPH = "abcdefghijklmnopqrstuvwxyz";
long long p[300][300][300];
long long n, m;
void norm(long long &x, long long &y) {
  long long v = min(min(x, y), 0LL);
  x -= v;
  y -= v;
  v = min(min(x - n - 1, m - n - 1), 0LL);
  x += v;
  y += v;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<vector<long long> > a(n, vector<long long>(m)),
      pref(n, vector<long long>(m));
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (long long j = 0; j < m; j++) {
      a[i][j] = (s[j] == '#');
    }
  }
  long long xx = n + m;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      long long x = i - 1, y = j - 1;
      pref[i][j] = a[i][j];
      if (x >= 0 && x < n && y >= 0 && y < m) {
        pref[i][j] += pref[x][y];
      }
    }
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      for (long long h = 1; h < max(n, m); h++) {
        long long x = i + h, y = j + h;
        long long x1 = x - h, y1 = y + h, x2 = x - 1, y2 = y + h + h - 1;
        norm(x1, y1);
        norm(x2, y2);
        if (!(x1 >= 0 && x1 < n) || !(y1 >= 0 && y1 < m) ||
            !(x2 >= 0 && x2 < n) || !(y2 >= 0 && y2 < m))
          continue;
        ans += pref[x2][y2] - pref[x1][y1] + a[x1][y1];
      }
    }
  }
  cout << ans / 2;
}
