#include <bits/stdc++.h>
using namespace std;
const int N = 300 + 5;
template <typename T>
bool cmax(T &a, T b) {
  return (a < b) ? a = b, 1 : 0;
}
template <typename T>
bool cmin(T &a, T b) {
  return (a > b) ? a = b, 1 : 0;
}
template <typename T>
T read() {
  T ans = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch) && ch != '-') ch = getchar();
  if (ch == '-') f = -1, ch = getchar();
  while (isdigit(ch))
    ans = (ans << 3) + (ans << 1) + (ch - '0'), ch = getchar();
  return ans * f;
}
template <typename T>
void write(T x, char y) {
  if (x == 0) {
    putchar('0'), putchar(y);
    return;
  }
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  static char wr[20];
  int top = 0;
  for (; x; x /= 10) wr[++top] = x % 10 + '0';
  while (top) putchar(wr[top--]);
  putchar(y);
}
void file() {}
int n, m;
char s[N][N];
void input() {
  n = read<int>(), m = read<int>();
  for (register int i = (int)(1); i <= (int)(n); ++i) scanf("%s", s[i] + 1);
}
long long ans;
int w[N << 1][N << 1], h[N << 1][N << 1], a[N << 1][N << 1];
struct node {
  int x, y;
} e[N * N];
int top;
void work() {
  int x, y;
  int Max = max(n, m) * 2;
  for (register int i = (int)(1); i <= (int)(n); ++i)
    for (register int j = (int)(1); j <= (int)(m); ++j)
      if (s[i][j] == '#') {
        x = i + j, y = i - j + Max;
        e[++top] = (node){x, y};
        a[x][y] = 1;
      }
  Max <<= 1;
  for (register int i = (int)(1); i <= (int)(Max); ++i)
    for (register int j = (int)(1); j <= (int)(Max); ++j)
      w[i][j] = w[i][j - 1] + a[i][j], h[i][j] = h[i - 1][j] + a[i][j];
  for (register int i = (int)(1); i <= (int)(top); ++i) {
    x = e[i].x, y = e[i].y;
    for (int d = 2; d <= Max; d += 2) {
      if (y + d <= Max && a[x][y + d]) {
        if (x - d > 0) ans += w[x - d][y + d] - w[x - d][y - 1];
        if (x + d <= Max) ans += w[x + d][y + d] - w[x + d][y - 1];
      }
      if (x + d <= Max && a[x + d][y]) {
        if (y - d > 0) ans += h[x + d - 1][y - d] - h[x][y - d];
        if (y + d <= Max) ans += h[x + d - 1][y + d] - h[x][y + d];
      }
    }
  }
  write(ans, '\n');
}
int main() {
  input();
  work();
  return 0;
}
