#include <bits/stdc++.h>
using namespace std;
const long long mod = (long long)(1e+9) + 7;
const long long INF = (long long)1000000007 * 1000000007;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
bool coin[300][300];
long long s1[600][301];
vector<int> v1[600];
long long s2[600][301];
vector<int> v2[600];
int main() {
  int h, w;
  cin >> h >> w;
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      char in;
      cin >> in;
      if (in == '#')
        coin[i][j] = true;
      else
        coin[i][j] = false;
    }
  }
  for (int i = 0; i < h + w - 1; i++) {
    for (int j = 0; j < h; j++) {
      int k = i - j;
      s1[i][j + 1] = s1[i][j];
      if (0 <= k && k < w && coin[j][k]) {
        s1[i][j + 1]++;
        v1[i].push_back(j);
      }
    }
  }
  for (int i = 0; i < h + w - 1; i++) {
    for (int j = 0; j < h; j++) {
      int k = j + w - 1 - i;
      s2[i][j + 1] = s2[i][j];
      if (0 <= k && k < w && coin[j][k]) {
        s2[i][j + 1]++;
        v2[i].push_back(j);
      }
    }
  }
  long long out = 0;
  for (int i = 0; i < h + w - 1; i++) {
    int len = v1[i].size();
    for (int j = 0; j < len; j++) {
      for (int k = j + 1; k < len; k++) {
        int x1 = v1[i][j];
        int y1 = i - x1;
        int x2 = v1[i][k];
        int y2 = i - x2;
        int dis = (x2 - x1) * 2;
        int ni = i - dis;
        if (ni >= 0) {
          int sta = max(-1, ni - y2);
          int owa = x1;
          out += 2 * (s1[ni][owa + 1] - s1[ni][sta]);
          if (ni - x1 >= 0 && coin[x1][ni - x1]) out--;
          if (ni - y2 >= 0 && coin[ni - y2][y2]) out--;
        }
        ni = i + dis;
        if (ni <= h + w - 1) {
          int sta = x2;
          int owa = min(h - 1, ni - y1);
          out += 2 * (s1[ni][owa + 1] - s1[ni][sta]);
          if (ni - y1 < h && coin[ni - y1][y1]) out--;
          if (ni - x2 < w && coin[x2][ni - x2]) out--;
        }
      }
    }
  }
  for (int i = 0; i < h + w - 1; i++) {
    int len = v2[i].size();
    for (int j = 0; j < len; j++) {
      for (int k = j + 1; k < len; k++) {
        int x1 = v2[i][j];
        int y1 = x1 + w - 1 - i;
        int x2 = v2[i][k];
        int y2 = x2 + w - 1 - i;
        int dis = (x2 - x1) * 2;
        int ni = i - dis;
        if (ni >= 0) {
          int sta = max(-1, x2 - dis);
          int owa = x1;
          out += 2 * (s2[ni][owa + 1] - s2[ni][sta]);
          if (x2 - dis >= 0 && coin[x2 - dis][y2]) out--;
          if (y1 + dis < w && coin[x1][y1 + dis]) out--;
        }
        ni = i + dis;
        if (ni <= h + w - 1) {
          int sta = x2;
          int owa = min(h - 1, x1 + dis);
          out += 2 * (s2[ni][owa + 1] - s2[ni][sta]);
          if (y2 - dis >= 0 && coin[x2][y2 - dis]) out--;
          if (x1 + dis < h && coin[x1 + dis][y1]) out--;
        }
      }
    }
  }
  cout << out / 2 << endl;
  return 0;
}
