#include <bits/stdc++.h>
using namespace std;
int h, w;
char c[305][305];
int map[2005][2005];
int sum[2005][2005];
const int Zero = 1000;
int rect(int sx, int sy, int tx, int ty) {
  return sum[Zero + tx][Zero + ty] - sum[Zero + sx - 1][Zero + ty] -
         sum[Zero + sx][Zero + ty - 1] + sum[Zero + sx - 1][Zero + sy - 1];
}
int main(void) {
  cin >> h >> w;
  for (int y = 1; y <= h; y++) {
    for (int x = 1; x <= w; x++) {
      cin >> c[x][y];
    }
  }
  for (int x = 1; x <= w; x++) {
    for (int y = 1; y <= h; y++) {
      int u = x + y, v = x - y;
      if (c[x][y] == '#') map[Zero + u][Zero + v] = 1;
    }
  }
  for (int x = 1; x < 2005; x++) {
    for (int y = 1; y < 2005; y++) {
      sum[x][y] = sum[x - 1][y] + sum[x][y - 1] - sum[x - 1][y - 1] + map[x][y];
    }
  }
  int ans = 0;
  for (int x = 1; x <= w; x++) {
    for (int y = 1; y <= h; y++) {
      int u = x + y, v = x - y;
      for (int d = 1; d <= 605; d++) {
        ans += map[Zero + u + d][Zero + v] * rect(u, v - d, u + d, v - d);
        ans += map[Zero + u + d][Zero + v] * rect(u, v + d, u + d, v + d);
        ans += map[Zero + u - d][Zero + v] * rect(u - d, v - d, u, v - d);
        ans += map[Zero + u - d][Zero + v] * rect(u - d, v + d, u, v + d);
        ans += map[Zero + u][Zero + v + d] * rect(u - d, v, u - d, v + d);
        ans += map[Zero + u][Zero + v + d] * rect(u + d, v, u + d, v + d);
        ans += map[Zero + u][Zero + v - d] * rect(u - d, v - d, u - d, v);
        ans += map[Zero + u][Zero + v - d] * rect(u + d, v - d, u + d, v);
      }
    }
  }
  ans /= 6;
  cout << ans - 1 << endl;
  return 0;
}
