#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7fffffff;
const int MAXN = +3;
unsigned long long ans;
int h, w;
char g[303][303];
vector<pair<int, int> > v;
long long INDEX, f[303][303];
inline int absi(const int &x) {
  if (x < 0) return -x;
  return x;
}
inline bool ok(const pair<int, int> &a) {
  return (a.first >= 0 && a.second >= 0 && a.first < h && a.second < w);
}
inline pair<int, int> U(const pair<int, int> &a, const int &x) {
  return {a.first - x, a.second};
}
inline pair<int, int> D(const pair<int, int> &a, const int &x) {
  return {a.first + x, a.second};
}
inline pair<int, int> L(const pair<int, int> &a, const int &x) {
  return {a.first, a.second - x};
}
inline pair<int, int> R(const pair<int, int> &a, const int &x) {
  return {a.first, a.second + x};
}
inline bool coin(const pair<int, int> &a) {
  return g[a.first][a.second] == '#';
}
inline int dist(const pair<int, int> &a, const pair<int, int> &b) {
  return absi(a.first - b.first) + absi(a.second - b.second);
}
inline void mark(const pair<int, int> &a) { f[a.first][a.second] = INDEX; }
inline bool have(const pair<int, int> &a) {
  if (!ok(a)) return 0;
  return f[a.first][a.second] == INDEX;
}
void calc(pair<int, int> p1, pair<int, int> p2) {
  INDEX++;
  pair<int, int> t1, t2, t3, t4;
  int r = dist(p1, p2);
  for (int i = 0; i <= r; i++) {
    t1 = U(L(p1, i), (r - i));
    t2 = U(R(p1, i), (r - i));
    t3 = D(L(p1, i), (r - i));
    t4 = D(R(p1, i), (r - i));
    if (ok(t1) && coin(t1)) mark(t1);
    if (ok(t2) && coin(t2)) mark(t2);
    if (ok(t3) && coin(t3)) mark(t3);
    if (ok(t4) && coin(t4)) mark(t4);
  }
  for (int i = 0; i <= r; i++) {
    t1 = U(L(p2, i), (r - i));
    t2 = U(R(p2, i), (r - i));
    t3 = D(L(p2, i), (r - i));
    t4 = D(R(p2, i), (r - i));
    if (have(t1)) ans++;
    if (t2 != t1 && have(t2)) ans++;
    if (t3 != t1 && t3 != t2 && have(t3)) ans++;
    if (t4 != t1 && t4 != t2 && t4 != t3 && have(t4)) ans++;
  }
}
int main() {
  cin >> h >> w;
  for (int i = 0; i < (int)(h); i++) {
    for (int j = 0; j < (int)(w); j++) {
      cin >> g[i][j];
      if (g[i][j] == '#') {
        v.push_back({i, j});
      }
    }
  }
  for (int ii = 0; ii < (int)(v.size()); ii++) {
    for (int jj = ii + 1; jj < v.size(); jj++) {
      pair<int, int> i = v[ii];
      pair<int, int> j = v[jj];
      calc(i, j);
    }
  }
  cout << ans / 3;
  return 0;
}
