#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  return (b < a) ? (a = b, 1) : 0;
}
using ll = long long;
using R = long double;
const R EPS = 1e-9L;
inline int sgn(const R &r) { return (r > EPS) - (r < -EPS); }
inline R sq(R x) { return sqrt(max(x, 0.0L)); }
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const pid_t pid = getpid();
const int offset = 300;
char board[600][600];
int hsum[610][610];
int vsum[610][610];
int main(void) {
  int h, w;
  cin >> h >> w;
  const int n = 601;
  for (int i = int(0); i < int(n); ++i)
    for (int j = int(0); j < int(n); ++j) board[i][j] = '.';
  for (int y = int(0); y < int(h); ++y)
    for (int x = int(0); x < int(w); ++x) {
      char tmp;
      cin >> tmp;
      const int ny = x + y + 1;
      const int nx = x - y + offset + 1;
      board[ny][nx] = tmp;
    }
  for (int y = int(0); y < int(n); ++y) {
    for (int x = int(1); x < int(n); ++x) {
      hsum[y][x] = (board[y][x] == '#');
      hsum[y][x] += hsum[y][x - 1];
    }
  }
  for (int x = int(0); x < int(n); ++x) {
    for (int y = int(1); y < int(n); ++y) {
      vsum[y][x] = (board[y][x] == '#');
      vsum[y][x] += vsum[y - 1][x];
    }
  }
  ll ans = 0LL;
  for (int y = int(0); y < int(n); ++y)
    for (int x = int(0); x < int(n); ++x) {
      if (board[y][x] == '.') continue;
      for (int r = int(1); r < int(n + 1); ++r) {
        bool lft = (x - r >= 1);
        bool rht = (x + r < n);
        bool top = (y - r >= 1);
        bool btm = (y + r < n);
        if (rht and board[y][x + r] == '#') {
          if (btm) {
            ans += hsum[y + r][x + r] - hsum[y + r][x - 1];
          }
        }
        if (btm and board[y + r][x] == '#') {
          if (lft) {
            ans += vsum[y + r][x - r] - vsum[y][x - r];
          }
          if (rht) {
            ans += vsum[y + r][x + r] - vsum[y][x + r];
          }
        }
        if (btm) {
          for (int cx = int(x - r + 1); cx < int(x); ++cx) {
            if (cx <= 0 or n <= cx) continue;
            if (cx + r <= 0 or n <= cx + r) continue;
            ans += (board[y + r][cx] == '#') * (board[y + r][cx + r] == '#');
          }
        }
      }
    }
  cout << ans << endl;
  return 0;
}
