#include <bits/stdc++.h>
using namespace std;
int d(pair<int, int> p1, pair<int, int> p2) {
  return abs(p1.first - p2.first) + abs(p1.second - p2.second);
}
signed main() {
  cin.tie(0);
  cout << setprecision(10);
  int h, w;
  cin >> h >> w;
  vector<vector<char>> a(h);
  vector<pair<int, int>> p;
  for (int i = (0); i < (h); i++) {
    a[i].resize(w);
    for (int j = (0); j < (w); j++) {
      cin >> a[i][j];
      if (a[i][j] == '#') p.push_back(pair<int, int>(i, j));
    }
  }
  int count = 0;
  for (int i = (0); i < (p.size()); i++) {
    for (int j = (i + 1); j < (p.size()); j++) {
      for (int k = (j + 1); k < (p.size()); k++) {
        if (d(p[i], p[j]) == d(p[j], p[k]) && d(p[j], p[k]) == d(p[k], p[i]) &&
            d(p[k], p[i]) == d(p[i], p[j]))
          count++;
      }
    }
  }
  cout << count << endl;
}
