#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const int MAX_LEN = 1000;
const int OFFSET = 330;
int main() {
  int h, w;
  cin >> h >> w;
  vector<vector<int>> field0(MAX_LEN, vector<int>(MAX_LEN, 0));
  vector<vector<int>> field1(MAX_LEN, vector<int>(MAX_LEN, 0));
  vector<vector<int>> field2(MAX_LEN, vector<int>(MAX_LEN, 0));
  string line;
  for (int i = 0; i < h; i++) {
    cin >> line;
    for (int j = 0; j < w; j++) {
      if (line[j] == '#') {
        field0[OFFSET + i][OFFSET + j] = 1;
        field1[OFFSET + i][OFFSET + j] = 1;
        field2[OFFSET + i][OFFSET + j] = 1;
      }
    }
  }
  for (int i = 0; i < h; i++) {
    int j = 0;
    while (OFFSET + i + j + 1 < MAX_LEN && OFFSET + j + 1 < MAX_LEN) {
      field1[OFFSET + i + j + 1][OFFSET + j + 1] +=
          field1[OFFSET + i + j][OFFSET + j];
      j++;
    }
  }
  for (int i = 1; i < w; i++) {
    int j = 0;
    while (OFFSET + j + 1 < MAX_LEN && OFFSET + i + j + 1 < MAX_LEN) {
      field1[OFFSET + j + 1][OFFSET + i + j + 1] +=
          field1[OFFSET + j][OFFSET + i + j];
      j++;
    }
  }
  for (int i = 0; i < h; i++) {
    int j = 0;
    while (OFFSET + i + j + 1 < MAX_LEN && OFFSET + w - 1 - j - 1 >= 0) {
      field2[OFFSET + i + j + 1][OFFSET + w - 1 - j - 1] +=
          field2[OFFSET + i + j][OFFSET + w - 1 - j];
      j++;
    }
  }
  for (int i = 1; i < w; i++) {
    int j = 0;
    while (OFFSET + j + 1 < MAX_LEN && OFFSET + w - 1 - i - j - 1 >= 0) {
      field2[OFFSET + j + 1][OFFSET + w - 1 - i - j - 1] +=
          field2[OFFSET + j][OFFSET + w - 1 - i - j];
      j++;
    }
  }
  int ans = 0;
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      for (int d = 1; d < 155; d++) {
        if (field0[OFFSET + i][OFFSET + j] == 1 &&
            field0[OFFSET + i + d][OFFSET + j - d] == 1) {
          ans += field2[OFFSET + i - 1][OFFSET + j - d - d + 1] -
                 field2[OFFSET + i - d - 1][OFFSET + j - d + 1];
          ans += field2[OFFSET + i + d + d - 1][OFFSET + j + 1] -
                 field2[OFFSET + i + d - 1][OFFSET + j + d + 1];
        }
        if (field0[OFFSET + i][OFFSET + j] == 1 &&
            field0[OFFSET + i + d][OFFSET + j + d] == 1) {
          ans += field1[OFFSET + i][OFFSET + j + d + d] -
                 field1[OFFSET + i - d - 1][OFFSET + j + d - 1];
          ans += field1[OFFSET + i + d + d - 1][OFFSET + j - 1] -
                 field1[OFFSET + i + d][OFFSET + j - d];
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
