#include <bits/stdc++.h>
using namespace std;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  std::fill((T *)array, (T *)(array + N), val);
}
struct Edge {
  int from, to, s;
};
signed main() {
  int h, w;
  cin >> h >> w;
  int mp[301][301] = {};
  int ruip[1201][603] = {}, ruim[1201][603] = {};
  for (int i = (0); (h) > i; i++) {
    char buf[302];
    scanf("%s", &buf);
    for (int j = (0); (w) > j; j++) {
      if (buf[j] == '#') mp[i][j] = 1;
      ruip[i + j + 600][i + 1] = mp[i][j];
      ruim[i - j + 600][i + 1] = mp[i][j];
    }
  }
  for (int i = (0); (1200) > i; i++) {
    for (int j = (0); (602) > j; j++) {
      ruip[i][j + 1] += ruip[i][j];
      ruim[i][j + 1] += ruim[i][j];
    }
  }
  long long ans = 0;
  for (int i = (0); (h) > i; i++) {
    for (int j = (0); (w) > j; j++) {
      for (int k = (1); (301) > k; k++) {
        long long cou = 0;
        int p = i - k + j, m = i - k - j + 600;
        cou += ruip[p][i + 1] - ruip[p][max(0, i - k)];
        cou += ruim[m][i + 1] - ruim[m][max(0, i - k + 1)];
        p = i + k + j, m = i + k - j + 600;
        cou += ruip[p][i + k + 1] - ruip[p][i + 1];
        cou += ruim[m][i + k] - ruim[m][i + 1];
        ans += cou * (cou - 1) * (cou - 2) / 3;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
