#include <bits/stdc++.h>
using namespace std;
int a[2009][2009];
int c1[2009][2009];
int c2[2009][2009];
int cn1(int s, int x1, int x2) {
  return c1[x2 + 300][s - x2 + 300] - c1[x1 - 1 + 300][s - x1 + 1 + 300];
}
int cn2(int s, int x1, int x2) {
  return c2[x2 + 300][-s + x2 + 300] - c2[x1 - 1 + 300][-s + x1 - 1 + 300];
}
int f(int x, int y) {
  if (x >= 0 && y >= 0 && a[x][y]) return 1;
  return 0;
}
int main() {
  int H, W;
  cin >> H >> W;
  for (int i = 1; i <= H; i++) {
    for (int j = 1; j <= W; j++) {
      char c;
      cin >> c;
      if (c == '#') a[i][j] = 1;
    }
  }
  for (int i = -W - 1; i <= H + H + W + 1; i++) {
    for (int j = -H - 1; j <= H + W + W + 1; j++) {
      c1[i + 300][j + 300] = c1[i - 1 + 300][j + 1 + 300];
      c2[i + 300][j + 300] = c2[i - 1 + 300][j - 1 + 300];
      if (i >= 0 && j >= 0 && a[i][j])
        c1[i + 300][j + 300]++, c2[i + 300][j + 300]++;
    }
  }
  int ans = 0;
  for (int i = 1; i <= H; i++) {
    for (int j = 1; j <= W; j++) {
      for (int d = 1; d <= H + W; d++) {
        int c1 = f(i, j + d);
        int c2 = f(i + d, j);
        int c3 = f(i, j - d);
        int c4 = f(i - d, j);
        int s3 = cn1(i + j + d, i, i + d);
        int s4 = cn2(i + d - j, i, i + d);
        int s1 = cn1(i + j - d, i - d, i);
        int s2 = cn2(i - j - d, i - d, i);
        if (c1 && c2) ans += s1;
        if (c2 && c3) ans += s2;
        if (c3 && c4) ans += s3;
        if (c4 && c1) ans += s4;
        if (c1 + c2 + c3 + c4 == 4) ans -= 4;
        if (c1 + c2 + c3 + c4 == 3) ans--;
      }
    }
  }
  cout << ans << endl;
}
