#include <bits/stdc++.h>
using namespace std;
const int N = 310;
char s[N][N];
bool f[N][N];
int n, m, ans;
bool valid(int x, int y) { return 0 <= x && x < n && 0 <= y && y < m; }
inline bool has(int x, int y) { return valid(x, y) && f[x][y]; }
int solve(int x, int y) {
  int ret = 0;
  int x1, y1, d, x2, y2;
  for (int g = 1;; g++) {
    d = g << 1;
    if (!valid(x - g, y + g) && !valid(x - g, y - g)) {
      break;
    }
    x1 = x;
    y1 = y + d;
    x2 = x - g;
    y2 = y + g;
    if (has(x - g, y + g) && has(x - g, y - g)) {
      ret++;
    }
    for (int j = 0; j < d + g; j++) {
      if (has(x1, y1) && has(x2, y2)) {
        ret++;
      }
      y1 = y1 - 1;
      if (y1 < y) {
        x1 = x1 + 1;
      } else {
        x1 = x1 - 1;
      }
      y2 = y2 - 1;
      if (y2 < y) {
        x2 = x2 + 1;
      } else {
        x2 = x2 - 1;
      }
    }
  }
  return ret;
}
int main() {
  while (~scanf("%d %d", &n, &m)) {
    for (int i = 0; i < n; i++) {
      scanf("%s", s[i]);
      for (int j = 0; j < m; j++) {
        if (s[i][j] == '#') {
          f[i][j] = 1;
        } else {
          f[i][j] = 0;
        }
      }
    }
    ans = 0;
    for (int i = n - 1; i >= 0; i--) {
      for (int j = 0; j < m; j++) {
        if (!f[i][j]) continue;
        ans += solve(i, j);
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
