#include <bits/stdc++.h>
using namespace std;
int main() {
  stringstream ss;
  long long H, W;
  cin >> H >> W;
  string s[H];
  for (long long i = (0); i <= (H - 1); i++) {
    cin >> s[i];
  }
  int Dnum = 0;
  long long ans = 0;
  int Dl[(H + 1) * (W + 1)];
  int Dm[(H + 1) * (W + 1)];
  for (long long D = (1); D <= (H + W); D++) {
    for (long long j = (0); j <= (H - 1); j++) {
      for (long long k = (0); k <= (W - 1); k++) {
        if (s[j][k] == '#') {
          Dnum = 0;
          for (long long l = (0); l <= (H - 1); l++) {
            if (D - abs(j - l) >= 0) {
              if (k + (D - abs(j - l)) >= 0 && k + (D - abs(j - l)) < W) {
                if (s[l][k + (D - abs(j - l))] == '#') {
                  Dnum++;
                  Dl[Dnum] = l;
                  Dm[Dnum] = k + (D - abs(j - l));
                }
              }
              if (k - (D - abs(j - l)) >= 0 && k - (D - abs(j - l)) < W &&
                  D - abs(j - l) != 0) {
                if (s[l][k - (D - abs(j - l))] == '#') {
                  Dnum++;
                  Dl[Dnum] = l;
                  Dm[Dnum] = k - (D - abs(j - l));
                }
              }
            }
          }
          for (long long p = (1); p <= (Dnum); p++) {
            for (long long q = (p + 1); q <= (Dnum); q++) {
              if (abs(Dl[p] - Dl[q]) + abs(Dm[p] - Dm[q]) == D) {
                ans++;
              }
            }
          }
        }
      }
    }
  }
  cout << ans / 3 << endl;
  return 0;
}
