#include <bits/stdc++.h>
using namespace std;
signed main() {
  int H, W;
  cin >> H >> W;
  int a[H + W - 1][H + W - 1];
  for (int i = 0; i < H + W - 1; i++) {
    for (int j = 0; j < H + W - 1; j++) {
      a[i][j] = 0;
    }
  }
  char y;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> y;
      if (y == '#') {
        a[i + j][i - j + W - 1] = 1;
      }
    }
  }
  int k = 0;
  for (int i = 0; i < (H + W - 1) * 2; i++) {
    for (int j = 0; j <= i; j++) {
      if (a[j][i - j] == 1) {
        for (int r = 2; j + r < (H + W - 1) && i - j + r < H + W - 1; j += 2) {
          if (a[j + r][i - j] == 1 && a[j + r][i - j + r] == 1) {
            k += 1;
          }
          if (a[j][i - j + r] == 1 && a[j + r][i - j + r] == 1) {
            k += 1;
          }
        }
      }
    }
  }
  cout << k;
  return 0;
}
