#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[8] = {1, 0, -1, 0, 1, 0, -1, 0};
int dy[8] = {0, 1, 0, -1, 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 diff(long long x1, long long y1, long long x2, long long y2) {
  if (x1 > x2)
    return diff(x2, y2, x1, y1);
  else if (x1 == x2)
    return 0;
  else {
    if (x1 + y1 == x2 + y2) {
      return cum1[x1 + y1 + H + W][x2 + H + W] -
             cum1[x1 + y1 + H + W][x1 + H + W + 1];
    }
    if (x1 - y1 == x2 - y2) {
      return cum2[x1 - y1 + H + W][x2 + H + W] -
             cum2[x1 - y1 + H + W][x1 + H + W + 1];
    }
  }
  return 0;
}
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++) {
      for (long long p = (long long)(1); p < (long long)(min(H, W) + 1); p++) {
        for (long long k = 0; k < (long long)(4); k++) {
          if (coin(i + dx[k] * p, j + dy[k] * p) &&
              coin(i + dx[k + 1] * p, j + dy[k + 1] * p)) {
            ans += diff(i + dx[k + 2] * p, j + dy[k + 2] * p, i + dx[k + 3] * p,
                        j + dy[k + 3] * p);
          }
        }
      }
    }
  }
  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();
  long long ans = right_eq() + eq();
  cout << ans << endl;
}
