#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++) {
      s[i][j] = in<char>() == '#';
    }
  }
  auto valid = [&](long long i, long long j) {
    return 0 <= i && i < H && 0 <= j && j < W;
  };
  auto exist = [&](long long i, long long j) { return valid(i, j) && s[i][j]; };
  VVI acc1(H + W - 1, VI(H + 1));
  for (long long l = 0, max_i = (H + W - 1); l < max_i; l++) {
    for (long long i = 0, max_i = (H); i < max_i; i++) {
      long long j = -(H - 1) + l + i;
      acc1[l][i + 1] = acc1[l][i];
      if (valid(i, j)) {
        acc1[l][i + 1] += s[i][j];
      }
    }
  }
  cerr << "acc1"
       << ": " << (acc1) << endl;
  VVI acc2(H + W - 1, VI(H + 1));
  for (long long l = 0, max_i = (H + W - 1); l < max_i; l++) {
    for (long long i = 0, max_i = (H); i < max_i; i++) {
      long long j = l - i;
      acc2[l][i + 1] = acc2[l][i];
      if (valid(i, j)) {
        acc2[l][i + 1] += s[i][j];
      }
    }
  }
  cerr << "acc2"
       << ": " << (acc2) << endl;
  long long ans = 0;
  for (long long l = 0, max_i = (H + W - 1); l < max_i; l++) {
    for (long long i = 0, max_i = (H); i < max_i; i++) {
      long long j = -(H - 1) + l + i;
      if (!exist(i, j)) {
        continue;
      }
      for (long long k = (1), max_i = (H + W - 1); k < max_i; k++) {
        if (!exist(i + k, j + k)) {
          continue;
        }
        if (l + 2 * k < H + W - 1) {
          long long tmp = acc1[l + 2 * k][i] - acc1[l + 2 * k][max(0LL, i - k)];
          if (tmp) {
            cerr << "l"
                 << ": " << (l) << endl;
            cerr << "i"
                 << ": " << (i) << endl;
            cerr << "j"
                 << ": " << (j) << endl;
            cerr << "k"
                 << ": " << (k) << endl;
            cerr << "hoge" << endl;
          }
          ans += tmp;
        }
        if (l - 2 * k >= 0) {
          long long tmp = acc1[l - 2 * k][min(H, i + 2 * k + 1)] -
                          acc1[l - 2 * k][min(H, i + k + 1)];
          if (tmp) {
            cerr << "l"
                 << ": " << (l) << endl;
            cerr << "i"
                 << ": " << (i) << endl;
            cerr << "j"
                 << ": " << (j) << endl;
            cerr << "k"
                 << ": " << (k) << endl;
          }
          ans += tmp;
        }
      }
    }
  }
  for (long long l = 0, max_i = (H + W - 1); l < max_i; l++) {
    for (long long i = 0, max_i = (H); i < max_i; i++) {
      long long j = l - i;
      if (!exist(i, j)) {
        continue;
      }
      for (long long k = (1), max_i = (H + W - 1); k < max_i; k++) {
        if (!exist(i + k, j - k)) {
          continue;
        }
        if (l + 2 * k < H + W - 1) {
          long long tmp = acc2[l + 2 * k][min(H - 1, i + 2 * k)] -
                          acc2[l + 2 * k][min(H - 1, i + k)];
          if (tmp) {
            cerr << "l"
                 << ": " << (l) << endl;
            cerr << "i"
                 << ": " << (i) << endl;
            cerr << "j"
                 << ": " << (j) << endl;
            cerr << "k"
                 << ": " << (k) << endl;
            cerr << "fuga" << endl;
          }
          ans += tmp;
        }
        if (l - 2 * k >= 0) {
          long long tmp =
              acc2[l - 2 * k][i + 1] - acc2[l - 2 * k][max(0LL, i - k + 1)];
          if (tmp) {
            cerr << "l"
                 << ": " << (l) << endl;
            cerr << "i"
                 << ": " << (i) << endl;
            cerr << "j"
                 << ": " << (j) << endl;
            cerr << "k"
                 << ": " << (k) << endl;
          }
          ans += tmp;
        }
      }
    }
  }
  cout << ans << endl;
}
