#include <bits/stdc++.h>
using namespace std;
static int n, m;
static char map[310 + 10][310 + 10];
static int pre[3 * 310 + 10][3 * 310 + 10];
void show() {
  for (int i = 1; i <= n; i++) printf("%s\n", map[i] + 1);
  puts("");
}
void rotate() {
  static char buf[310 + 10][310 + 10];
  memcpy(buf, map, sizeof(buf));
  memset(map, 0, sizeof(map));
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n; j++) map[i][j] = buf[n - j + 1][i];
  swap(n, m);
}
long long eval() {
  memset(pre, 0, sizeof(pre));
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) pre[310 + (i)][310 + (j)] = map[i][j] == '#';
  for (int i = 0; i <= (310 * 3 + 6); i++)
    for (int j = 1; i >= j; j++) pre[i - j][j] += pre[i - j + 1][j - 1];
  long long r = 0;
  for (int i = 1; i <= n + m; i++)
    for (int j = 0; i - j >= 1; j++)
      if (map[i - j][j + 1] == '#')
        for (int k = j + 1; i - k >= 1; k++)
          if (map[i - k][k + 1] == '#') {
            int d = (k - j) << 1;
            r += pre[310 + (i - j - d)][310 + (j + 1)] -
                 pre[310 + (i - k)][310 + (k - d + 1)];
          }
  return r;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", map[i] + 1);
  long long ans = eval();
  rotate();
  ans += eval();
  rotate();
  ans += eval();
  rotate();
  ans += eval();
  printf("%lld\n", ans);
  return 0;
}
