#include <bits/stdc++.h>
using namespace std;
long long mod(long long a) {
  long long c = a % (long long)(1E9 + 7);
  if (c >= 0)
    return c;
  else
    return c + (long long)(1E9 + 7);
}
long long max(long long a, long long b) {
  if (a < b)
    return b;
  else
    return a;
}
long long min(long long a, long long b) {
  if (a > b)
    return b;
  else
    return a;
}
void Max(long long* pos, long long val) { *pos = max(*pos, val); }
void Min(long long* pos, long long val) { *pos = min(*pos, val); }
void Add(long long* pos, long long val) { *pos = *pos + val; }
int h, w;
int a[305][305];
long long count() {
  long long ans = 0;
  vector<int> v[h + w - 1];
  int dp[h + w - 1][w + 1];
  memset(dp, 0, sizeof(dp));
  for (long long z = 0; z <= h + w - 2; z++) {
    for (long long j = 0; j <= w - 1; j++) {
      int i = z - j;
      if (0 <= i && i <= h - 1 && a[i][j] == 1) {
        v[z].push_back(j);
        dp[z][j]++;
      }
    }
  }
  for (long long i = 0; i <= h + w - 2; i++)
    for (long long j = 0; j <= w - 1; j++) dp[i][j + 1] += dp[i][j];
  for (long long z = 0; z <= h + w - 2; z++) {
    if (v[z].size() <= 1) continue;
    int vs = v[z].size();
    for (long long i = 0; i <= vs - 2; i++) {
      for (long long j = i + 1; j <= vs - 1; j++) {
        int ix = max(z - v[z][i], 0), iy = v[z][i];
        int jx = max(z - v[z][j], 0), jy = v[z][j];
        int r = (v[z][j] - v[z][i]) * 2;
        int y = z - r;
        if (y >= 0) {
          if (jy - r - 1 >= 0)
            ans += dp[y][iy] - dp[y][jy - r - 1];
          else
            ans += dp[y][iy];
        }
        y = z + r;
        if (y <= h + w - 2) {
          if (z - (jx + r) - 1 >= 0)
            ans += dp[y][min(iy + r, w - 1)] - dp[y][z - (jx + r) - 1];
          else
            ans += dp[y][min(iy + r, w - 1)];
        }
      }
    }
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> h >> w;
  string s[h];
  for (long long i = 0; i <= h - 1; i++) cin >> s[i];
  for (long long i = 0; i <= h - 1; i++)
    for (long long j = 0; j <= w - 1; j++) {
      if (s[i][j] == '.')
        a[i][j] = 0;
      else
        a[i][j] = 1;
    }
  long long an = count();
  for (long long i = 0; i <= h - 1; i++)
    for (long long j = 0; j <= w - 1; j++) {
      if (s[i][w - j - 1] == '.')
        a[i][j] = 0;
      else
        a[i][j] = 1;
    }
  an += count();
  cout << an / 2 << endl;
  return 0;
}
