#include <bits/stdc++.h>
using namespace std;
using II = pair<long long, long long>;
using VI = vector<long long>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
template <class T = long long>
inline T in() {
  T x;
  cin >> x;
  return x;
}
template <class T = long long>
inline bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T = long long>
inline bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
ostream &operator<<(ostream &s, const vector<T> &d) {
  long long n = d.size();
  for (long long i = 0, max_i = (n); i < max_i; i++) s << d[i] << " ";
  return s;
}
template <class T>
ostream &operator<<(ostream &s, const vector<vector<T>> &dd) {
  for (vector<T> d : dd) s << d << endl;
  return s;
}
struct Fast {
  Fast() {
    cin.tie(0);
    ios::sync_with_stdio(false);
  }
} fast;
const long long MOD = 1e9 + 7;
signed main() {
  long long H, W;
  cin >> H >> W;
  vector<vector<bool>> s(H, vector<bool>(W));
  for (long long i = 0, max_i = (H); i < max_i; i++) {
    for (long long j = 0, max_i = (W); j < max_i; j++) {
      char c;
      cin >> c;
      s[i][j] = c == '#';
    }
  }
  auto exist = [&](long long i, long long j) {
    return 0 <= i && i < H && 0 <= j && j < W && s[i][j];
  };
  long long ans = 0;
  for (long long i = 0, max_i = (H); i < max_i; i++) {
    for (long long j = 0, max_i = (W); j < max_i; j++) {
      for (long long k = 0, max_i = (300); k < max_i; k++) {
        bool a = exist(i - k, j - k);
        bool b = exist(i - k, j + k);
        bool c = exist(i + k, j - k);
        bool d = exist(i + k, j + k);
        ans += (a && b) + (a && c) + (b && d) + (c && d);
        ans += exist(i - 3 * k, j - k) && exist(i - k, j - 3 * k);
        ans += exist(i - 3 * k, j + k) && exist(i - k, j + 3 * k);
        ans += exist(i + 3 * k, j - k) && exist(i + k, j - 3 * k);
        ans += exist(i + 3 * k, j + k) && exist(i + k, j + 3 * k);
      }
    }
  }
  cout << ans << endl;
}
