#include <bits/stdc++.h>
using namespace std;
int n, m;
char f[305][305], ff[305][305];
long long ans;
vector<int> pos[605][305];
vector<int> cnt[605];
long long sol() {
  for (int i = 0; i < 605; i++) {
    cnt[i].clear();
    for (int j = 0; j < 305; j++) pos[i][j].clear();
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      if (f[i][j] != '#') continue;
      cnt[i + j].push_back(i);
    }
  for (int i = 0; i < 605; i++) sort(cnt[i].begin(), cnt[i].end());
  for (int i = 0; i < 605; i++) {
    if (cnt[i].empty()) continue;
    for (int j = 0; j < cnt[i].size(); j++)
      for (int k = j + 1; k < cnt[i].size(); k++) {
        int dif = cnt[i][k] - cnt[i][j];
        if (dif >= 305) break;
        pos[i][dif].push_back(cnt[i][j]);
      }
  }
  for (int i = 0; i < 605; i++)
    for (int j = 0; j < 305; j++) sort(pos[i][j].begin(), pos[i][j].end());
  long long ret = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      if (f[i][j] != '#') continue;
      for (int k = i + j + 2; k <= n - 1 + m - 1; k += 2) {
        int lb = i + 1, ub = k - j - (k - i - j) / 2 - 1;
        int x = (lower_bound(pos[k][(k - i - j) / 2].begin(),
                             pos[k][(k - i - j) / 2].end(), lb) -
                 pos[k][(k - i - j) / 2].begin());
        int y = (upper_bound(pos[k][(k - i - j) / 2].begin(),
                             pos[k][(k - i - j) / 2].end(), ub) -
                 pos[k][(k - i - j) / 2].begin());
        ans += y - x;
      }
      for (int k = i + j - 2; k >= 0; k -= 2) {
        int lb = k - j + 1, ub = i - (i + j - k) / 2 - 1;
        int x = (lower_bound(pos[k][(i + j - k) / 2].begin(),
                             pos[k][(i + j - k) / 2].end(), lb) -
                 pos[k][(i + j - k) / 2].begin());
        int y = (upper_bound(pos[k][(i + j - k) / 2].begin(),
                             pos[k][(i + j - k) / 2].end(), ub) -
                 pos[k][(i + j - k) / 2].begin());
        ans += y - x;
      }
    }
  return ret;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", &f[i]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++)
      for (int k = j + 1; k < m; k++) {
        if (f[i][j] == '#' && f[i][k] == '#' && j % 2 == k % 2) {
          int mm = (j + k) / 2;
          int d = (k - j) / 2;
          if (0 <= i - d && i - d < n && f[i - d][mm] == '#') ans++;
          if (0 <= i + d && i + d < n && f[i + d][mm] == '#') ans++;
        }
      }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++)
      for (int k = j + 1; k < n; k++) {
        if (f[j][i] == '#' && f[k][i] == '#' && j % 2 == k % 2) {
          int mm = (j + k) / 2;
          int d = (k - j) / 2;
          if (0 <= i - d && i - d < m && f[mm][i - d] == '#') ans++;
          if (0 <= i + d && i + d < m && f[mm][i + d] == '#') ans++;
        }
      }
  }
  ans += sol();
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) ff[i][j] = f[i][m - 1 - j];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) f[i][j] = ff[i][j];
  ans += sol();
  cout << ans << endl;
}
