#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &t) {
  os << "[";
  for (__typeof((t).begin()) it = (t).begin(); it != (t).end(); it++) {
    if (it != t.begin()) os << ",";
    os << *it;
  }
  os << "]";
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const set<T> &t) {
  os << "{";
  for (__typeof((t).begin()) it = (t).begin(); it != (t).end(); it++) {
    if (it != t.begin()) os << ",";
    os << *it;
  }
  os << "}";
  return os;
}
template <class S, class T>
ostream &operator<<(ostream &os, const map<S, T> &t) {
  os << "{";
  for (__typeof((t).begin()) it = (t).begin(); it != (t).end(); it++) {
    if (it != t.begin()) os << ",";
    os << *it;
  }
  os << "}";
  return os;
}
template <class S, class T>
ostream &operator<<(ostream &os, const pair<S, T> &t) {
  return os << "(" << t.first << "," << t.second << ")";
}
template <class S, class T>
pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first + t.first, s.second + t.second);
}
template <class S, class T>
pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first - t.first, s.second - t.second);
}
const int INF = 1 << 28;
const double EPS = 1e-8;
const int MOD = 1000000007;
int T, h, w;
string s;
long long int v[1005][1005];
long long int vsum[1005][1005];
long long int sum(int sx, int sy, int gx, int gy) {
  return vsum[gy][gx] - vsum[sy][gx] - vsum[gy][sx] + vsum[sy][sx];
}
long long int solve(int l) {
  long long int ans = 0;
  for (int i = 0; i < (int)(h + w + 5); i++) {
    for (int j = 0; j < (int)(h + w + 2); j++) {
      if (v[i][j]) {
        if (v[i + l][j]) {
          if (j + l <= h + w + 5) {
            ans += sum(j + l, i, j + l + 1, i + l + 1);
          }
          if (j - l > 0) {
            ans += sum(j - l, i, j - l + 1, i + l + 1);
          }
        }
        if (v[i][j + l]) {
          if (i + l <= h + w + 5) {
            ans += sum(j + 1, i + l, j + l, i + l + 1);
          }
          if (i - l > 0) {
            ans += sum(j + 1, i - l, j + l, i - l + 1);
          }
        }
      }
    }
  }
  return ans;
}
int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
  while (cin >> h >> w) {
    for (int i = 0; i < (int)(h); i++) {
      string s;
      cin >> s;
      for (int j = 0; j < (int)(w); j++) {
        if (s[j] == '#') {
          v[i + j][h + j - i] = 1;
        }
      }
    }
    for (int i = 1; i <= (int)(1000); i++) {
      for (int j = 1; j <= (int)(1000); j++) {
        vsum[i][j] = v[i - 1][j - 1] + vsum[i][j - 1] + vsum[i - 1][j] -
                     vsum[i - 1][j - 1];
      }
    }
    long long int ans = 0;
    for (int l = 1; l <= (int)(h + w + 2); l++) {
      ans += solve(l);
    }
    cout << ans << endl;
  }
  return 0;
}
