#include <bits/stdc++.h>
using namespace std;
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  bool exit = false;
  int H, W;
  cin >> H >> W;
  char S[H][W];
  char S1[H][W];
  char S2[W][H];
  char S3[H][W];
  char S4[W][H];
  for (i = 0; i < (H); i++) {
    for (j = 0; j < (W); j++) {
      cin >> S[i][j];
    }
  }
  for (i = 0; i < (H); i++) {
    for (j = 0; j < (W); j++) {
      S1[i][j] = S[i][j];
      S2[j][i] = S[H - 1 - i][j];
      S3[i][j] = S[H - 1 - i][W - 1 - j];
      S4[j][i] = S[i][W - 1 - j];
    }
  }
  int i1, i2, j1, j2, i3, j3;
  int L;
  int k3;
  int cnt = 0;
  for (k = 0; k < (H + W - 2); k++) {
    for (i1 = 0; i1 < (H); i1++) {
      j1 = k - i1;
      if (j1 < 0 or W <= j1) continue;
      for (i2 = 0; i2 < (i1); i2++) {
        j2 = k - i2;
        if (j2 < 0 or W <= j2) continue;
        L = abs(i1 - i2) + abs(j1 - j2);
        k3 = k - L;
        for (i3 = 0; i3 < (i2); i3++) {
          j3 = k3 - i3;
          if (j3 < 0 or j1 < j3) continue;
          if (S1[i1][j1] == '#' and S1[i2][j2] == '#' and S1[i3][j3] == '#') {
            cnt += 1;
          }
          if (S3[i1][j1] == '#' and S3[i2][j2] == '#' and S3[i3][j3] == '#') {
            cnt += 1;
          }
        }
      }
    }
  }
  for (k = 0; k < (H + W - 2); k++) {
    for (i1 = 0; i1 < (W); i1++) {
      j1 = k - i1;
      if (j1 < 0 or H <= j1) continue;
      for (i2 = 0; i2 < (i1); i2++) {
        j2 = k - i2;
        if (j2 < 0 or H <= j2) continue;
        L = abs(i1 - i2) + abs(j1 - j2);
        k3 = k - L;
        for (i3 = 0; i3 < (i2); i3++) {
          j3 = k3 - i3;
          if (j3 < 0 or j1 < j3) continue;
          if (S2[i1][j1] == '#' and S2[i2][j2] == '#' and S2[i3][j3] == '#') {
            cnt += 1;
          }
          if (S4[i1][j1] == '#' and S4[i2][j2] == '#' and S4[i3][j3] == '#') {
            cnt += 1;
          }
        }
      }
    }
  }
  cout << cnt << endl;
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false), cin.tie(0);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  cout.tie(0);
  solve();
  return 0;
}
