#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9 + 7;
const long long INF = 1LL << 60;
const long long mod = 1e9 + 7;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
long long h, w;
vector<vector<char>> s;
long long c[700][700];
long long x[710][710], y[710][710];
void solve() {
  cin >> h >> w;
  s.assign(h, vector<char>(w));
  for (long long i = 0; i < 700; i++) {
    for (long long j = 0; j < 700; j++) {
      c[i][j] = 0;
    }
  }
  for (long long i = 0; i < 710; i++) {
    for (long long j = 0; j < 710; j++) {
      x[i][j] = y[i][j] = 0;
    }
  }
  for (long long i = 0; i < h; i++) {
    for (long long j = 0; j < w; j++) {
      cin >> s[i][j];
      if (s[i][j] == '#') c[i + j + 350][i - j + 350]++;
    }
  }
  for (long long i = 0; i < 700; i++) {
    for (long long j = 0; j < 700; j++) {
      y[i][j + 1] = y[i][j] + c[i][j];
    }
  }
  for (long long i = 0; i < 700; i++) {
    for (long long j = 0; j < 700; j++) {
      x[i + 1][j] = x[i][j] + c[i][j];
    }
  }
  long long ans = 0;
  for (long long i = 0; i < 700; i++) {
    for (long long j = 1; j < 700; ++j) {
      for (long long k = j + 1; k < 700; ++k) {
        if (!c[j][i] || !c[k][i]) continue;
        long long d = k - j;
        if (i - d >= 0) ans += x[k + 1][i - d] - x[j][i - d];
        if (i + d < 700) ans += x[k + 1][i + d] - x[j][i + d];
      }
    }
  }
  for (long long i = 0; i < 700; i++) {
    for (long long j = 1; j < 700; ++j) {
      for (long long k = j + 1; k < 700; ++k) {
        if (!c[i][j] || !c[i][k]) continue;
        long long d = k - j;
        if (i - d >= 0) ans += y[i - d][k] - y[i - d][j + 1];
        if (i + d < 700) ans += y[i + d][k] - y[i + d][j + 1];
      }
    }
  }
  cout << ans << endl;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
