#include <bits/stdc++.h>
using namespace std;
long long ans, res;
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > v;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < m; j++) {
      if (s[j] == '#') v.push_back({i, j});
    }
  }
  for (int i = 0; i < v.size(); i++) {
    for (int j = i + 1; j < v.size(); j++) {
      int k = abs(v[i].first - v[j].first) + abs(v[i].second - v[j].second);
      for (int z = j + 1; z < v.size(); z++) {
        int l = abs(v[i].first - v[z].first) + abs(v[i].second - v[z].second);
        int x = abs(v[j].first - v[z].first) + abs(v[j].second - v[z].second);
        if (k == l and l == x) ans++;
      }
    }
  }
  cout << ans;
  return 0;
}
