#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using ll = long long;
ll calc(vi& a, vi& b) {
  ll ret = 0;
  int an = a.size();
  int i = 0;
  for (int mb : b) {
    for (; i < an; i++) {
      if (mb < a[i]) break;
      if (mb == a[i]) {
        ret++;
        break;
      }
    }
  }
  return ret;
}
int main(void) {
  int h, w;
  while (scanf("%d%d\n", &h, &w) == 2) {
    vi p;
    for (int y = 0; y < h; y++) {
      char s[300 + 2];
      scanf("%300[.#]\n", s);
      for (int x = 0; x < w; x++) {
        if (s[x] == '#') p.push_back((y << 16) | x);
      }
    }
    int n = p.size();
    vvvi d(n);
    for (int i = 0; i < n; i++) {
      d[i].resize(300 + 300);
      int sx = p[i] & 0xffff;
      int sy = p[i] >> 16;
      for (int j = i + 1; j < n; j++) {
        int x = p[j] & 0xffff;
        int y = p[j] >> 16;
        int t = abs(x - sx) + abs(y - sy);
        d[i][t].push_back(j);
      }
    }
    ll ans = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 2; j < d[i].size(); j += 2) {
        if (d[i][j].size() < 2) continue;
        for (int k : d[i][j]) {
          ans += calc(d[i][j], d[k][j]);
        }
      }
    }
    printf("%lld\n", ans);
  }
  return 0;
}
