#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
template <class T>
ostream &operator<<(ostream &o, const vector<T> &v) {
  o << "{";
  for (long long i = 0; i < (long long)v.size(); i++)
    o << (i > 0 ? ", " : "") << v[i];
  o << "}";
  return o;
}
long long h, w, l, q, ans;
long long a[800][1000] = {};
long long c[1000][1000] = {};
long long tate[1000][1008] = {};
long long yoko[1000][1008] = {};
string s;
signed main() {
  std::cin >> h >> w;
  for (long long i = 0; i < h; i++) {
    std::cin >> s;
    for (long long j = 0; j < w; j++) {
      if (s[j] == '#') {
        c[i + j][i - j + w - 1] = 1;
      }
    }
  }
  for (long long i = 0; i < h + w - 1; i++) {
    long long r = 0;
    for (long long j = 0; j < w + h - 1; j++) {
      r += c[i][j];
      yoko[i][j + 1] = r;
    }
  }
  for (long long i = 0; i < h + w - 1; i++) {
    long long r = 0;
    for (long long j = 0; j < w + h - 1; j++) {
      r += c[j][i];
      tate[j + 1][i] = r;
    }
  }
  for (long long i = 0; i < h + w - 1; i++) {
    for (long long j = 0; j < h + w - 1; j++) {
      if (c[i][j]) {
        for (long long k = 1; k < h + w - i; k++) {
          if ((c[i + k][j])) {
            ans += tate[i + k + 1][j + k] - tate[i + 1][j + k];
          }
        }
        for (long long k = 1; k < i + 1; k++) {
          if (c[i - k][j]) {
            ans += tate[i + 1][j + k] - tate[i - k + 1][j + k];
          }
        }
      }
    }
  }
  for (long long i = 0; i < h + w - 1; i++) {
    for (long long j = 0; j < h + w - 1; j++) {
      if (c[i][j]) {
        for (long long k = 1; k < h + w - j; k++) {
          if (c[i][j + k]) {
            ans += yoko[i + k][j + k + 1] - yoko[i + k][j + 1];
          }
        }
        for (long long k = 1; k < j + 1; k++) {
          if (c[i][j - k]) {
            ans += yoko[i + k][j + 1] - yoko[i + k][j - k + 1];
          }
        }
      }
    }
  }
  std::cout << ans << '\n';
}
