#include <bits/stdc++.h>
using namespace std;
const double EPS = (1e-7);
const long long INF = (1e9);
const double PI = (acos(-1));
const long long MOD = long long(1e9) + 7;
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 (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; };
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const long long MAX_H = 300, MAX_W = 300;
long long H, W;
bool grid[MAX_H][MAX_W];
bool coin(long long x, long long y) {
  if (0 <= x && x < H && 0 <= y && y < W && grid[x][y])
    return true;
  else
    return false;
}
long long cum1[2 * (MAX_H + MAX_W + 1)][2 * (MAX_H + MAX_W + 1)] = {};
long long cum2[2 * (MAX_H + MAX_W + 1)][2 * (MAX_H + MAX_W + 1)] = {};
void f() {
  for (long long k = 0; k < (long long)(2 * (H + W) + 1); k++) {
    for (long long x = 0; x < (long long)(2 * (H + W) + 1); x++) {
      cum1[k][x + 1] = cum1[k][x] + coin(x - (H + W), k - x);
      cum2[k][x + 1] = cum2[k][x] + coin(x - (H + W), x - k);
    }
  }
}
long long eq() {
  long long ans = 0;
  for (long long i = 0; i < (long long)(H); i++) {
    for (long long j = 0; j < (long long)(W); j++) {
      if (grid[i][j]) {
        for (long long p = (long long)(1); p < (long long)(min(H, W)); p++) {
          if (coin(i + p, j + p)) {
            ans += cum2[i - j + 2 * p + (H + W)][i + p + H + W + p] -
                   cum2[i - j + 2 * p + (H + W)][i + p + H + W + 1] +
                   cum2[i - j - 2 * p + (H + W)][i - p + H + W + p] -
                   cum2[i - j - 2 * p + (H + W)][i - p + H + W + 1];
          }
          if (coin(i + p, j - p)) {
            ans += cum1[i + j + 2 * p + H + W][i + p + H + W + p] -
                   cum1[i + j + 2 * p + H + W][i + p + H + W + 1] +
                   cum1[i + j - 2 * p + H + W][i - p + H + W + p] -
                   cum1[i + j - 2 * p + H + W][i - p + H + W + 1];
          }
        }
      }
    }
  }
  return ans;
}
long long right_eq() {
  long long ans = 0;
  for (long long i = 0; i < (long long)(H); i++) {
    for (long long j = 0; j < (long long)(W); j++) {
      for (long long p = (long long)(1); p < (long long)(min(H, W)); p++) {
        if (coin(i + p, j) && coin(i, j + p) && coin(i, j - p)) ans++;
        if (coin(i + p, j) && coin(i, j + p) && coin(i - p, j)) ans++;
        if (coin(i + p, j) && coin(i, j - p) && coin(i - p, j)) ans++;
        if (coin(i - p, j) && coin(i, j + p) && coin(i, j - p)) ans++;
      }
    }
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> H >> W;
  for (long long i = 0; i < (long long)(H); i++) {
    for (long long j = 0; j < (long long)(W); j++) {
      char s;
      cin >> s;
      (s == '#') ? grid[i][j] = true : grid[i][j] = false;
    }
  }
  f();
  cout << right_eq() + eq() << endl;
}
