#include <bits/stdc++.h>
using namespace std;
int H, W;
string s[300];
vector<pair<int, int>> coin;
int d(int x1, int x2, int y1, int y2) { return abs(x1 - x2) + abs(y1 - y2); }
int main() {
  cin >> H >> W;
  for (int i = 0; i < H; i++) {
    cin >> s[i];
    for (int j = 0; j < W; j++) {
      if (s[i][j] == '#') coin.push_back(make_pair(i, j));
    }
  }
  long long ans = 0;
  for (int i = 0; i < coin.size(); i++) {
    for (int j = i + 1; j < coin.size(); j++) {
      int dis = d(coin[i].first, coin[j].first, coin[i].second, coin[j].second);
      if (coin[i].second - coin[j].second < 0) {
        int h = coin[i].first;
        int w = coin[i].second - (coin[i].second - coin[j].second);
        if (d(h, coin[j].first, w, coin[j].second) == dis && s[h][w] == '#')
          ans++;
        while (h < coin[j].first) {
          h++;
          w++;
          if (d(h, coin[j].first, w, coin[j].second) == dis && s[h][w] == '#')
            ans++;
        }
      } else {
        int h = coin[i].first;
        int w = coin[i].second + (coin[i].second - coin[j].second);
        if (d(h, coin[j].first, w, coin[j].second) == dis && s[h][w] == '#')
          ans++;
        while (h < coin[j].first) {
          h++;
          w--;
          if (d(h, coin[j].first, w, coin[j].second) == dis && s[h][w] == '#')
            ans++;
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
