#include <bits/stdc++.h>
using namespace std;
class XYplane {
 public:
  int x;
  int y;
  friend int M_dist(XYplane &a, XYplane &b) {
    return abs(a.x - b.x) + abs(a.y - b.y);
  }
  XYplane(int xx, int yy) : x(xx), y(yy) {}
};
bool distance_judge(XYplane &a, XYplane &b, XYplane &c) {
  if (M_dist(a, b) == M_dist(b, c) && M_dist(b, c) == M_dist(c, a)) {
    return 1;
  } else {
    return 0;
  }
}
int main() {
  int H, W;
  cin >> H >> W;
  vector<XYplane> vec;
  int count = 0;
  for (int loop1 = 0; loop1 < H; loop1++) {
    for (int loop2 = 0; loop2 < W; loop2++) {
      char c;
      cin >> c;
      if (c == '#') {
        XYplane xy(loop1, loop2);
        vec.push_back(xy);
      } else if (c == '.') {
        continue;
      }
    }
  }
  int answer = 0;
  int cnt1st = 0, cnt2nd = 0, cnt3rd = 0;
  for (int cnt1st = 0; cnt1st < vec.size() - 2; cnt1st++) {
    for (int cnt2nd = cnt1st + 1; cnt2nd < vec.size() - 1; cnt2nd++) {
      for (int cnt3rd = cnt2nd + 1; cnt3rd < vec.size(); cnt3rd++) {
        if (distance_judge(vec.at(cnt1st), vec.at(cnt2nd), vec.at(cnt3rd))) {
          answer++;
        } else {
        }
      }
    }
  }
  cout << answer << endl;
}
