#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
struct edge {
  ll to;
  ll cost;
};
using graph = vector<vector<edge>>;
const ll INF = 1e18;
inline void chmax(ll& a, ll b) { a = max(a, b); }
inline void chmin(ll& a, ll b) { a = min(a, b); }
double pi = acos(-1);
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll d[305][305];
ll a[610][305];
ll b[610][305];
ll aa[610];
ll bb[610];
int main() {
  ll h, w;
  cin >> h >> w;
  for (ll i = 0; i < (610); ++i) {
    for (ll j = 0; j < (305); ++j) {
      a[i][j] = 0;
      b[i][j] = 0;
    }
  }
  for (ll i = 0; i < (h); ++i) {
    for (ll j = 0; j < (w); ++j) {
      char ww;
      cin >> ww;
      if (ww == '#') {
        d[i][j] = 1;
        ll ee = j - i + 305;
        ll ff = i + j;
        for (ll v = i; v <= 303; v++) {
          a[ee][v + 1]++;
        }
        for (ll v = i; v <= 303; v++) {
          b[ff][v + 1]++;
        }
      } else
        d[i][j] = 0;
    }
  }
  for (ll i = 0; i < (610); ++i) {
    aa[i] = a[i][304];
    bb[i] = b[i][304];
  }
  ll ans = 0;
  for (ll i = 0; i < (h); ++i) {
    for (ll j = 0; j < (w); ++j) {
      if (d[i][j] == 1) {
        ll now = j - i;
        ll mow = i + j;
        for (ll r = 0; r < (i); ++r) {
          if (r + now >= 0 && r + now < w && d[r][r + now] == 1) {
            ll x = now + 2 * i - 2 * r + 305;
            ll y = now - 2 * i + 2 * r + 305;
            if (0 <= x && x < 610)
              ans += a[x][r + 1] - a[x][max(0ll, 2 * r - i)];
            if (0 <= y && y < 610)
              ans += a[x][min(303ll, 2 * i - r + 1)] - a[x][r];
          }
          if (0 <= mow - r && mow - r < w && d[r][mow - r] == 1) {
            ll z = mow + 2 * i - 2 * r;
            ll w = mow - 2 * i + 2 * r;
            if (0 <= z && z < 610)
              ans += b[z][min(303ll, 2 * i - r + 1)] - b[z][r];
            if (0 <= w && w < 610)
              ans += b[w][r + 1] - b[w][max(0ll, 2 * r - i)];
          }
        }
      }
    }
  }
  ll rest = 0;
  for (ll i = 0; i < (h); ++i) {
    for (ll j = 0; j < (w); ++j) {
      if (d[i][j] == 0) continue;
      for (ll u = j + 1; u <= w - 1; u++) {
        if (d[i][u] == 0) continue;
        ll g = (u - j) / 2;
        if ((u - j) % 2 == 0) {
          if (i - g >= 0 && d[i - g][(j + u) / 2] == 1) rest++;
          if (i + g < h && d[i + g][(j + u) / 2] == 1) rest++;
        }
      }
      for (ll u = i + 1; u <= h - 1; u++) {
        if (d[u][j] == 0) continue;
        ll g = (u - i) / 2;
        if ((u - i) % 2 == 0) {
          if (j - g > 0 && d[(u + i) / 2][j - g] == 1) rest++;
          if (j + g < w && d[(u + i) / 2][j + g] == 1) rest++;
        }
      }
    }
  }
  cout << ans - rest << endl;
  return 0;
}
