#include <bits/stdc++.h>
using namespace std;
void Debug() { cout << '\n'; }
template <class FIRST, class... REST>
void Debug(FIRST arg, REST... rest) {
  cout << arg << " ";
  Debug(rest...);
}
template <class T>
ostream& operator<<(ostream& out, const vector<T>& v) {
  out << "[";
  if (!v.empty()) {
    for (int i = int(0); i < int((int)(v).size() - 1); i++) out << v[i] << ", ";
    out << v.back();
  }
  out << "]";
  return out;
}
template <class S, class T>
ostream& operator<<(ostream& out, const pair<S, T>& v) {
  out << "(" << v.first << ", " << v.second << ")";
  return out;
}
const int MAX_N = 200010;
const int MAX_V = 100010;
const double eps = 1e-6;
const long long mod = 1000000007;
const int inf = 1 << 30;
const long long linf = 1LL << 60;
const double PI = 3.14159265358979323846;
int N, M, K;
int X[MAX_N], Y[MAX_N];
int B[610][610];
int S[610][610];
void solve() {
  cin >> N >> M;
  for (int i = int(0); i < int(N); i++) {
    string str;
    cin >> str;
    for (int j = int(0); j < int(M); j++) {
      if (str[j] == '#') {
        X[K] = i;
        Y[K] = j;
        K++;
      }
    }
  }
  for (int i = int(0); i < int(K); i++) {
    int x = X[i], y = Y[i];
    X[i] = x - y + 300;
    Y[i] = x + y + 300;
  }
  long long cnt1 = 0, cnt2 = 0;
  for (int q = int(0); q < int(4); q++) {
    memset(B, 0, sizeof(B));
    memset(S, 0, sizeof(S));
    for (int i = int(0); i < int(K); i++) {
      B[X[i]][Y[i]] = 1;
      S[X[i]][Y[i] + 1] = 1;
    }
    for (int i = int(0); i < int(600); i++) {
      for (int j = int(0); j < int(600); j++) {
        S[i][j + 1] += S[i][j];
      }
    }
    for (int i = int(0); i < int(K); i++) {
      int x = X[i], y = Y[i];
      for (int z = int(y) - 1; z >= int(0); z--) {
        if (B[x][z]) {
          int d = y - z;
          if (x - d >= 0) {
            cnt1 += S[x - d][y + 1] - S[x - d][z];
            if (B[x - d][z]) cnt2++;
            if (B[x - d][y]) cnt2++;
          }
        }
      }
    }
    for (int i = int(0); i < int(K); i++) {
      int x = X[i] - 300, y = Y[i] - 300;
      X[i] = -y + 300;
      Y[i] = x + 300;
    }
  }
  cout << cnt1 - cnt2 + cnt2 / 2 << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed;
  cout.precision(20);
  srand((unsigned int)time(NULL));
  solve();
  return 0;
}
