#include <bits/stdc++.h>
using namespace std;
const long long MAX_H = 310;
const long long MAX_W = 310;
const long long MAX_T = MAX_H * 2;
long long H, W;
char Field[MAX_H][MAX_W];
long long T_Field[MAX_T][MAX_T];
long long T_Sum[MAX_T][MAX_T];
long long getT(long long sx, long long sy, long long gx, long long gy) {
  return T_Sum[gy][gx] - T_Sum[gy][sx] - T_Sum[sy][gx] + T_Sum[sy][sx];
}
signed main() {
  cin >> H >> W;
  for (long long y = (0); y < (H); ++y) {
    for (long long x = (0); x < (W); ++x) {
      cin >> Field[y][x];
      if (Field[y][x] == '#') {
        T_Field[x + y][y - x + MAX_W] = 1;
      }
    }
  }
  for (long long y = (0); y < (MAX_T - 1); ++y) {
    for (long long x = (0); x < (MAX_T - 1); ++x) {
      T_Sum[y + 1][x + 1] =
          T_Sum[y + 1][x] + T_Sum[y][x + 1] - T_Sum[y][x] + T_Field[y][x];
    }
  }
  long long ans = 0;
  for (long long y = (0); y < (MAX_T); ++y) {
    for (long long x = (0); x < (MAX_T); ++x) {
      if (T_Field[y][x] == 0) {
        continue;
      }
      for (long long nx = (x + 1); nx < (MAX_T); ++nx) {
        long long d = nx - x;
        if (T_Field[y][nx] == 0) {
          continue;
        }
        if (0 <= y - d) {
          ans += getT(x, y - d, nx + 1, y - d + 1);
        }
        if (y + d < MAX_T) {
          ans += getT(x, y + d, nx + 1, y + d + 1);
        }
      }
      for (long long ny = (y + 1); ny < (MAX_T); ++ny) {
        long long d = ny - y;
        if (T_Field[ny][x] == 0) {
          continue;
        }
        if (0 <= x - d) {
          ans += getT(x - d, y + 1, x - d + 1, ny);
        }
        if (x + d < MAX_T) {
          ans += getT(x + d, y + 1, x + d + 1, ny);
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
