#include <bits/stdc++.h>
using namespace std;
int n, m;
char a[300][300];
int b[305][305], hor[305][305], ver[305][305];
string s;
long long solve() {
  long long res = 0;
  for (int i = 0; i < (int)(305); ++i) {
    hor[i][0] = 0;
    for (int j = 0; j < (int)(304); ++j) {
      hor[i][j + 1] = hor[i][j] + b[i][j];
    }
  }
  for (int j = 0; j < (int)(305); ++j) {
    ver[0][j] = 0;
    for (int i = 0; i < (int)(304); ++i) {
      ver[i + 1][j] = ver[i][j] + b[i][j];
    }
  }
  for (int i = 0; i < (int)(300); ++i) {
    for (int jj = 0; jj < (int)(300); ++jj)
      for (int j = 0; j < (int)(jj); ++j) {
        if (!b[i][j] || !b[i][jj]) {
          continue;
        }
        int ii = i - (jj - j);
        if (ii >= 0 && ii < 300) {
          res += hor[ii][jj + 1] - hor[ii][j];
        }
        ii = i + (jj - j);
        if (ii >= 0 && ii < 300) {
          res += hor[ii][jj + 1] - hor[ii][j];
        }
      }
  }
  for (int j = 0; j < (int)(300); ++j) {
    for (int ii = 0; ii < (int)(300); ++ii)
      for (int i = 0; i < (int)(ii); ++i) {
        if (!b[i][j] || !b[ii][j]) {
          continue;
        }
        int jj = j - (ii - i);
        if (jj >= 0 && jj < 300) {
          res += ver[ii][jj] - ver[i + 1][jj];
        }
        jj = j + (ii - i);
        if (jj >= 0 && jj < 300) {
          res += ver[ii][jj] - ver[i + 1][jj];
        }
      }
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < (int)(n); ++i) {
    cin >> s;
    for (int j = 0; j < (int)(m); ++j) {
      a[i][j] = s[j];
    }
  }
  long long ans = 0;
  for (int t = 0; t < (int)(2); ++t) {
    memset(b, 0, sizeof b);
    for (int i = 0; i < (int)(n); ++i)
      for (int j = 0; j < (int)(m); ++j) {
        if ((i + j) % 2 == t && a[i][j] == '#') {
          b[(i + j + t) / 2][(i - j + t) / 2 + 150] = 1;
        }
      }
    ans += solve();
  }
  cout << ans << endl;
  return 0;
}
