#include <bits/stdc++.h>
using namespace std;
int main() {
  int H, W;
  cin >> H >> W;
  bool A[910][910] = {};
  for (int i = 300; i < 300 + H; i++) {
    for (int j = 300; j < 300 + W; j++) {
      char c;
      cin >> c;
      if (c == '#') {
        A[i][j] = 1;
      }
    }
  }
  int B[610][1810] = {};
  for (int i = 300; i < 600; i++) {
    for (int j = 600 - i; j <= 600; j++) {
      if (A[i][j] == 1) {
        B[i][i + j] = B[i - 1][i + j] + 1;
      } else {
        B[i][i + j] = B[i - 1][i + j];
      }
    }
  }
  long long int count1 = 0;
  for (int K = 600; K <= 1198; K++) {
    for (int i = 300; i < 600; i++) {
      for (int j = i + 1; j < 600; j++) {
        if (A[i][K - i] == 1 && A[j][K - j] == 1) {
          count1 +=
              B[2 * j - i][K + 2 * j - 2 * i] - B[j - 1][K + 2 * j - 2 * i];
          count1 +=
              B[i][K + 2 * i - 2 * j] - B[2 * i - j - 1][K + 2 * i - 2 * j];
        }
      }
    }
  }
  bool D[910][910] = {};
  for (int i = 0; i < 910; i++) {
    for (int j = 0; j < 910; j++) {
      D[i][j] = A[599 + H - i][j];
    }
  }
  int E[610][1810] = {};
  for (int i = 300; i < 600; i++) {
    for (int j = 600 - i; j <= 600; j++) {
      if (D[i][j] == 1) {
        E[i][i + j] = E[i - 1][i + j] + 1;
      } else {
        E[i][i + j] = E[i - 1][i + j];
      }
    }
  }
  long long int count2 = 0;
  for (int K = 600; K <= 1198; K++) {
    for (int i = 300; i < 600; i++) {
      for (int j = i + 1; j < 600; j++) {
        if (D[i][K - i] == 1 && D[j][K - j] == 1) {
          count2 +=
              E[2 * j - i - 1][K + 2 * j - 2 * i] - E[j][K + 2 * j - 2 * i];
          count2 +=
              E[i - 1][K + 2 * i - 2 * j] - E[2 * i - j][K + 2 * i - 2 * j];
        }
      }
    }
  }
  cout << count1 + count2 << endl;
}
