#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
int main() {
  int h, w;
  cin >> h >> w;
  std::vector<std::string> s(h);
  std::map<int, std::map<int, char>> mp;
  for (int i = 0; i < h; i++) {
    cin >> s[i];
    for (int j = 0; j < w; j++) {
      mp[i + j][i - j] = s[i][j];
    }
  }
  std::map<int, std::map<int, long long>> A, B;
  for (int i = 0; i < h + w; i++) {
    for (int j = -w; j < h; j++) {
      A[i][j + 1] = A[i][j] + (mp[i][j] == '#');
      B[i + 1][j] = B[i][j] + (mp[i][j] == '#');
    }
  }
  std::map<int, std::map<int, long long>> C, D;
  for (int i = 0; i < h + w; i++) {
    for (int j = -w; j < h; j++) {
      C[i][j + 1] = C[i][j] + A[i][j];
      D[i + 1][j] = D[i][j] + B[i][j];
    }
  }
  long long ans = 0;
  for (int i = 0; i < h + w; i++) {
    for (int j = -w; j < h; j++) {
      for (int k = 0; k < 300; k++) {
        long long latte = A[i - k][j + k] - A[i - k][j - k - 1];
        latte += A[i + k][j + k] - A[i + k][j - k - 1];
        latte += B[i + k - 1][j - k] - B[i - k][j - k];
        latte += B[i + k - 1][j + k] - B[i - k][j + k];
        long long malta = C[i - k][j + k] - C[i - k][j - k - 1];
        malta += C[i + k][j + k] - C[i + k][j - k - 1];
        malta += D[i + k - 1][j - k] - D[i - k][j - k];
        malta += D[i + k - 1][j + k] - D[i - k][j + k];
        malta -= latte;
        ans += latte * malta;
      }
    }
  }
  cout << ans / 6 << endl;
  return 0;
}
