#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
using ll = long long;
using uint = unsigned int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ull = unsigned long long;
using ld = long double;
template <typename T>
void _(const char* s, T h) {
  cerr << s << " = " << h << "\n";
}
template <typename T, typename... Ts>
void _(const char* s, T h, Ts... t) {
  int b = 0;
  while (((b += *s == '(') -= *s == ')') != 0 || *s != ',') cerr << *s++;
  cerr << " = " << h << ",";
  _(s + 1, t...);
}
struct init {
  init() {
    cin.tie(0);
    iostream::sync_with_stdio(0);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(5);
  }
  ~init() {}
} init;
template <typename T, typename U>
void upx(T& x, U y) {
  if (x < y) x = y;
}
template <typename T, typename U>
void upn(T& x, U y) {
  if (x > y) x = y;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int D = 4, dx[] = {+1, 0, -1, 0}, dy[] = {0, +1, 0, -1};
const int N = 303;
char first[N][N];
short pr[N][N][N], pl[N][N][N];
int n, m;
short g(short x, short y) {
  if (1 <= x && x <= n && 1 <= y && y <= m) return first[x][y] == '#';
  return 0;
}
short tl(short x, short y, short d) {
  if (x <= 0 || y <= 0) return 0;
  short delta = max(x - n, y - m);
  upx(delta, 0);
  return (x <= delta || y <= delta) ? 0 : pl[x - delta][y - delta][d];
}
short tr(short x, short y, short d) {
  if (x <= 0 || y > m) return 0;
  short delta = max(x - n, 1 - y);
  upx(delta, 0);
  return (x <= delta || y + delta > m) ? 0 : pr[x - delta][y + delta][d];
}
short gl(short x1, short y1, short x2, short y2, short d) {
  return tl(x2, y2, d) - tl(x1 - 1 + d, y1 - 1 + d, d);
}
short gr(short x1, short y1, short x2, short y2, short d) {
  return tr(x2, y2, d) - tr(x1 - 1 + d, y1 + 1 - d, d);
}
int32_t main() {
  cin >> n >> m;
  int second = n + m;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      cin >> first[i][j];
      for (int d = 0; d + d <= second; d++) {
        pl[i][j][d] = pl[i - 1][j - 1][d] + g(i, j) * g(i - d, j - d);
        pr[i][j][d] = pr[i - 1][j + 1][d] + g(i, j) * g(i - d, j + d);
      }
    }
  uint ans = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (first[i][j] == '#') {
        for (int d = 1; d + d <= second; d++) {
          if (g(i - d, j - d)) {
            ans += gl(i - d - d + 1, j + 1, i - d, j + d, 0);
            ans += gl(i + 1, j - d - d + 1, i + d, j - d, 0);
          }
          if (g(i + d, j + d)) {
            ans += gl(i - d, j + d, i - 1, j + d + d - 1, 0);
            ans += gl(i + d, j - d, i + d + d - 1, j - 1, 0);
          }
          if (g(i - d, j + d)) {
            ans += gr(i - d - d + 1, j - 1, i - d - 1, j - d + 1, 0);
            ans += gr(i + 1, j + d + d - 1, i + d - 1, j + d + 1, 0);
          }
          if (g(i + d, j - d)) {
            ans += gr(i - d + 1, j - d - 1, i - 1, j - d - d + 1, 0);
            ans += gr(i + d + 1, j + d - 1, i + d + d - 1, j + 1, 0);
          }
          ans += gl(i - d - d, j, i, j + d + d, d);
          ans += gl(i, j - d - d, i + d + d, j, d);
          ans += gr(i - d - d, j, i, j - d - d, d);
          ans += gr(i, j + d + d, i + d + d, j, d);
        }
      }
    }
  }
  cout << ans / 3 << '\n';
  return 0;
}
