#include <bits/stdc++.h>
using namespace std;
const int off = 300;
int n, m;
int dl[710][710], dr[710][710];
char s[310][310];
int get_dl(int idx, int l, int r) {
  if (l > r) return 0;
  if (idx < 0 || idx >= 710) return 0;
  return dl[idx][r] - dl[idx][l - 1];
}
int get_dr(int idx, int l, int r) {
  if (l > r) return 0;
  if (idx < 0 || idx >= 710) return 0;
  return dr[idx][r] - dr[idx][l - 1];
}
int get(int y, int x) {
  if (y < 1 || x < 1 || y > n || x > m) return 0;
  return s[y][x] == '#';
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (s[i][j] == '#') {
        dl[i + j][j]++;
        dr[i - j + off][j]++;
      }
    }
  }
  for (int i = 0; i < 700; i++) {
    for (int j = 0; j <= 700; j++) {
      dl[i][j + 1] += dl[i][j];
      dr[i][j + 1] += dr[i][j];
    }
  }
  long long r1 = 0, r2 = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (s[i][j] != '#') continue;
      for (int k = 2; k <= max(n, m); k += 2) {
        int c11 = get_dr(i - j + off - k, j + 1, j + k / 2 - 1);
        int c12 = get_dr(i - j + off - k, j + k / 2 + 1, j + k - 1);
        int c21 = get_dl(i + j + k, j + k / 2 + 1, j + k - 1);
        int c22 = get_dl(i + j + k, j + 1, j + k / 2 - 1);
        int c31 = get_dr(i - j + off + k, j - k / 2 + 1, j - 1);
        int c32 = get_dr(i - j + off + k, j - k + 1, j - k / 2 - 1);
        int c41 = get_dl(i + j - k, j - k + 1, j - k / 2 - 1);
        int c42 = get_dl(i + j - k, j - k / 2 + 1, j - 1);
        int ru = get(i - k / 2, j + k / 2);
        int rd = get(i + k / 2, j + k / 2);
        int long double = get(i + k / 2, j - k / 2);
        int lu = get(i - k / 2, j - k / 2);
        int u = get(i - k, j);
        int r = get(i, j + k);
        int d = get(i + k, j);
        int l = get(i, j - k);
        r1 += rd * (c12 + c31);
        r1 += long double * (c22 + c41);
        r1 += lu * (c32 + c11);
        r1 += ru * (c21 + c42);
        r2 += rd * (long double + r + d);
        r2 += long double * (lu + l + d);
        r2 += lu * (ru + l + u);
        r2 += ru * (rd + r + u);
      }
    }
  }
  printf("%lld", r1 / 2 + r2 / 3);
  return 0;
}
