#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, w;
  cin >> h >> w;
  vector<string> v(h);
  for (int i = (int)(0); i < (int)(h); i++) cin >> v[i];
  long ans = 0;
  for (int i = -w + 2; i < h; i++) {
    int ii = i, jj = 0;
    while (ii < 0) {
      ii++;
      jj++;
    }
    while ((ii >= 0 && ii < h && jj >= 0 && jj < w)) {
      if (v[ii][jj] == '#') {
        int p = ii + 1, q = jj + 1;
        while ((p >= 0 && p < h && q >= 0 && q < w)) {
          {};
          if (v[p][q] == '#') {
            int d = p - ii;
            for (int pp = ii - d, qq = jj + d; pp <= ii; pp++, qq++) {
              if ((pp >= 0 && pp < h && qq >= 0 && qq < w) && v[pp][qq] == '#')
                ans++;
            }
            for (int pp = ii + d, qq = jj - d; qq <= jj; pp++, qq++) {
              if ((pp >= 0 && pp < h && qq >= 0 && qq < w) && v[pp][qq] == '#')
                ans++;
            }
          }
          p++;
          q++;
        }
      }
      ii++;
      jj++;
    }
  }
  for (int i = 0; i < h + w - 1; i++) {
    int ii = i, jj = 0;
    while (!(ii >= 0 && ii < h && jj >= 0 && jj < w)) {
      ii--;
      jj++;
    }
    while ((ii >= 0 && ii < h && jj >= 0 && jj < w)) {
      if (v[ii][jj] == '#') {
        int p = ii - 1, q = jj + 1;
        while ((p >= 0 && p < h && q >= 0 && q < w)) {
          {};
          if (v[p][q] == '#') {
            int d = ii - p;
            for (int pp = ii - d - 1, qq = jj - d + 1; qq < jj; pp--, qq++) {
              if ((pp >= 0 && pp < h && qq >= 0 && qq < w) && v[pp][qq] == '#')
                ans++;
            }
            for (int pp = ii + d - 1, qq = jj + d + 1; pp > ii; pp--, qq++) {
              if ((pp >= 0 && pp < h && qq >= 0 && qq < w) && v[pp][qq] == '#')
                ans++;
            }
          }
          p--;
          q++;
        }
      }
      ii--;
      jj++;
    }
  }
  cout << ans << endl;
  return 0;
}
