#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int h, w, i, j, k, c[301][301], coins = 0, x[900001], y[900001], a, b,
                                  ans = 0, m;
  char s[301][301];
  cin >> h >> w;
  for (i = 0; i < h; i++) {
    cin >> s[i];
    for (j = 0; j < w; j++) {
      if (s[i][j] == '#')
        c[i + 1][j + 1] = 1;
      else
        c[i + 1][j + 1] = 0;
    }
    if (c[i + 1][j + 1] == 1) {
      coins++;
      x[coins] = i + 1;
      y[coins] = j + 1;
    }
  }
  for (i = 1; i < coins; i++) {
    for (j = i + 1; j <= coins; j++) {
      m = abs(x[i] - x[j]) + abs(y[i] - y[j]);
      if (m % 2 == 1) continue;
      if (x[i] == x[j]) {
        if (x[i] - m / 2 >= 1 && c[x[i] - m][(y[i] + y[j]) / 2] == 1) ans++;
        if (x[i] + m / 2 <= h && c[x[i] + m][(y[i] + y[j]) / 2] == 1) ans++;
      } else {
        if (y[i] == y[j]) {
          if (y[i] - m / 2 >= 1 && c[(x[i] + x[j]) / 2][y[i] - m] == 1) ans++;
          if (y[i] + m / 2 <= w && c[(x[i] + x[j]) / 2][y[i] + m] == 1) ans++;
        } else if (y[i] < y[j]) {
          if (y[j] + m / 2 <= w && c[x[j] - m / 2][y[j] + m / 2] == 1) ans++;
          if (y[i] - m / 2 >= 1 && c[x[i] + m / 2][y[i] - m / 2] == 1) ans++;
        } else {
          if (y[j] - m / 2 >= 1 && c[x[j] + m / 2][y[j] - m / 2] == 1) ans++;
          if (y[i] + m / 2 <= w && c[x[i] - m / 2][y[i] + m / 2] == 1) ans++;
        }
      }
    }
  }
  cout << ans / 3 << endl;
  return 0;
}
