#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int h, w;
  cin >> h >> w;
  const int M = 300;
  string a[h];
  for (int i = 0; i < h; i++) cin >> a[i];
  auto in = [&](int x, int y) { return 0 <= x && x < h && 0 <= y && y < w; };
  auto f = [&](int s, int t, int c) {
    int x = (s + t) / 2, y = (s - t) / 2;
    while (c--) {
      swap(x, y);
      x = M - x - 1;
    }
    if (in(x, y)) return a[x][y] == '#';
    return false;
  };
  long long ans = 0, ans2 = 0;
  for (int c = 0; c < 4; c++) {
    for (int s = 0; s < 2 * M - 1; s++) {
      for (int d = 2; s + d < 2 * M - 1; d += 2) {
        int ss = s + d, curr = 0, yi = max(0, s - M + 1);
        for (int i = 0; i < d / 2; i++) {
          if (f(ss, ss - 2 * (yi + i), c) && f(ss, ss - 2 * (yi + i) - d, c))
            curr++;
        }
        for (int y = yi; y < M; y++) {
          if (f(ss, ss - 2 * (y + d), c) && f(ss, ss - 2 * (y + d) + d, c))
            curr++;
          if (f(s, s - 2 * y, c)) {
            ans += curr;
            ans2 +=
                f(ss, ss - 2 * (y + d), c) && f(ss, ss - 2 * (y + d) + d, c);
            ans2 += f(ss, ss - 2 * y, c) && f(ss, ss - 2 * y - d, c);
          }
          if (f(ss, ss - 2 * y, c) && f(ss, ss - 2 * y - d, c)) curr--;
        }
      }
    }
  }
  cout << ans - ans2 / 2 << "\n";
  return 0;
}
