#include <bits/stdc++.h>
using namespace std;
int main() {
  int H, W;
  cin >> H >> W;
  vector<string> V(H + W, string(W + W, '.'));
  int id = 0;
  for (int i = 0; i < H; ++i) {
    string s;
    cin >> s;
    for (int j = 0; j < s.size(); ++j) {
      if (s[j] == '#') {
        V[i + j][i + W - 1 - j] = '#';
      }
    }
  }
  int N = H + W;
  vector<vector<int> > A(N, vector<int>(N, 0));
  for (int i = 0; i < N; ++i) {
    int s = 0;
    for (int j = 0; j < N; ++j) {
      s += V[i][j] == '#';
      A[i][j] = s;
      if (i) A[i][j] += A[i - 1][j];
    }
  }
  auto sum = [&](int i0, int i1, int j0, int j1) {
    if (i0 > i1) return 0;
    if (j0 > j1) return 0;
    int s = A[i1][j1];
    if (j0) s -= A[i1][j0 - 1];
    if (i0) s -= A[i0 - 1][j1];
    if (j0 && i0) s += A[i0 - 1][j0 - 1];
    return s;
  };
  long long t = 0;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N; ++j) {
      if (V[i][j] == '#') {
        for (int k = 1; (k + i) < N && (k + j) < N; ++k) {
          if (V[i][j + k] == '#') {
            t += sum(i + k, i + k, j, j + k);
          }
          if (V[i + k][j] == '#') {
            t += sum(i + 1, i + k, j + k, j + k);
          }
        }
        for (int k = 1; (i - k) >= 0 && (j - k) >= 0; ++k) {
          if (V[i][j - k] == '#') {
            t += sum(i - k, i - k, j - k + 1, j);
          }
          if (V[i - k][j] == '#') {
            t += sum(i - k + 1, i - 1, j - k, j - k);
          }
        }
      }
    }
  }
  cout << t << endl;
  return 0;
}
