#include <bits/stdc++.h>
template <class T>
bool chmax(T &a, const T &b) {
  return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  return (b < a) ? (a = b, 1) : 0;
}
using namespace std;
using ll = long long;
using vi = vector<long long>;
using vll = vector<ll>;
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf = 1LL << 62;
const ll mod = 1000000007LL;
const long long dx[4] = {1, 0, -1, 0};
const long long dy[4] = {0, 1, 0, -1};
ll extgcd(ll a, ll b, ll &x, ll &y) {
  x = 1, y = 0;
  ll g = a;
  if (b != 0) g = extgcd(b, a % b, y, x), y -= a / b * x;
  return g;
}
ll ADD(const ll &a, const ll &b, const ll &mod) { return (a + b) % mod; }
ll SUB(const ll &a, const ll &b, const ll &mod) { return (a - b + mod) % mod; }
ll MUL(const ll &a, const ll &b, const ll &mod) { return (1LL * a * b) % mod; }
ll DIV(const ll &a, const ll &b, const ll &mod) {
  ll x, y;
  extgcd(b, mod, x, y);
  return MUL(a, (x + mod) % mod, mod);
}
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<long long> dice(1, 6);
uniform_real_distribution<double> score(0.0, 10.0);
long long h, w;
const long long o = 320;
inline bool check(long long x, long long y) {
  return 0 <= x and x < w and 0 <= y and y < h;
}
long long solve(vector<string> &f_in, long long t) {
  vector<vi> f(h, vi(w));
  for (long long y = (long long)(0); y < (long long)(h); ++y) {
    for (long long x = (long long)(0); x < (long long)(w); ++x) {
      if (f_in[y][x] == '#') f[y][x] = 1;
    }
  }
  vector<vi> tbl(o * 3, vi(o * 3));
  for (long long yy = (long long)(0); yy < (long long)(h); ++yy) {
    for (long long xx = (long long)(0); xx < (long long)(w); ++xx) {
      if (not f[yy][xx]) continue;
      for (long long k = (long long)(1); k < (long long)(o); ++k) {
        long long x = xx + k, y = yy - k;
        if (not check(x, y)) break;
        if (not f[y][x]) continue;
        tbl[o + y - t][o + xx - k + t] += 1;
        tbl[o + yy - 2 * k - 1 + t][o + xx + 1 - t] -= 1;
        tbl[o + yy + k - t][o + x + t] += 1;
        tbl[o + yy - 1 + t][o + xx + 2 * k + 1 - t] -= 1;
      }
    }
  }
  for (long long yy = (long long)(1); yy < (long long)(o * 3); ++yy) {
    for (long long k = (long long)(1); k < (long long)(yy + 1); ++k) {
      long long y = yy - k, x = k;
      tbl[y][x] += tbl[y + 1][x - 1];
    }
  }
  long long ret = 0;
  for (long long y = (long long)(0); y < (long long)(h); ++y) {
    for (long long x = (long long)(0); x < (long long)(w); ++x) {
      ret += tbl[o + y][o + x] * f[y][x];
    }
  }
  return ret;
}
signed main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> h >> w;
  vector<string> f_in(h);
  for (auto &e : f_in) cin >> e;
  long long res = solve(f_in, true);
  for (long long y = (long long)(0); y < (long long)(h); ++y)
    reverse(begin(f_in[y]), end(f_in[y]));
  res += solve(f_in, false);
  cout << res << endl;
  return 0;
}
