#include <bits/stdc++.h>
using namespace std;
char field[324][324];
long long lsum[323][324];
long long rsum[324][324];
long long res = 0;
long long h, w;
long long cntl(long long x, long long y) {
  if (x - y < 1 - w || x - y > h - 1) return 0;
  if (x < 0) {
    long long k = x;
    x += k;
    y += k;
  }
  if (y < 0) {
    long long k = y;
    x += k;
    y += k;
  }
  if (x > h) {
    long long k = x - h;
    x -= k;
    y -= k;
  }
  if (y > w + 1) {
    long long k = y - w - 1;
    x -= k;
    y -= k;
  }
  return lsum[x][y];
}
long long cntr(long long x, long long y) {
  if (x + y < 2 || x + y > h + w) return 0;
  if (x < 0) {
    long long k = -x;
    x += k;
    y -= k;
  }
  if (y < 0) {
    long long k = -y;
    x -= k;
    y += k;
  }
  if (x > h) {
    long long k = x - h;
    x -= k;
    y += k;
  }
  if (y > w + 1) {
    long long k = y - w - 1;
    x += k;
    y -= k;
  }
  return rsum[x][y];
}
int main() {
  cin >> h >> w;
  for (long long i = 1; i <= h; i++) {
    for (long long j = 1; j <= w; j++) {
      cin >> field[i][j];
    }
  }
  for (long long i = 0; i <= h; i++) {
    for (long long j = 0; j <= w + 1; j++) {
      if (i == 0 || j == 0)
        lsum[i][j] = 0;
      else
        lsum[i][j] = lsum[i - 1][j - 1] + (field[i][j] == '#');
      if (i == 0 || j == w + 1)
        rsum[i][j] = 0;
      else
        rsum[i][j] = rsum[i - 1][j + 1] + (field[i][j] == '#');
    }
  }
  for (long long i = 1; i <= h; i++) {
    for (long long j = 1; j <= w; j++) {
      if (field[i][j] == '.') continue;
      long long xi = i + 1, xj = j + 1;
      for (; xi <= h && xj <= w; xi++, xj++) {
        if (field[xi][xj] == '.') continue;
        res += cntl(xi + xi - i, j) - cntl(xi - 1, j + j - xj - 1);
        res += cntl(i, xj + xj - j) - cntl(i + i - xi - 1, xj - 1);
      }
      xi = i + 1, xj = j - 1;
      for (; xi <= h && xj >= 1; xi++, xj--) {
        if (field[xi][xj] == '.') continue;
        res += cntr(xi + xi - i - 1, j + 1) - cntr(xi, j + j - xj);
        res += cntr(i - 1, xj + xj - j + 1) - cntr(i + i - xi, xj);
      }
    }
  }
  cout << res << endl;
  return 0;
}
