#include <bits/stdc++.h>
using namespace std;
long long grid[1000][1000];
long long n, m, ans;
void dodiag1(long long x, long long y, long long d) {
  long long x2 = x + d;
  long long y2 = y + d;
  long long a1 = x - d;
  long long b1 = y + d;
  long long a2 = a1 + d;
  long long b2 = b1 + d;
  long long i1 = x + d;
  long long j1 = y - d;
  long long i2 = i1 + d;
  long long j2 = j1 + d;
  long long am = 0;
  long long a = a1;
  long long b = b1;
  while (a <= a2 && b <= b2) {
    am += grid[a][b];
    a++;
    b++;
  }
  a = i1;
  b = j1;
  while (a <= i2 && b <= j2) {
    am += grid[a][b];
    a++;
    b++;
  }
  while (x2 <= 300 + n && y2 <= 300 + m) {
    if (grid[x][y] && grid[x2][y2]) ans += am;
    am -= grid[a1++][b1++];
    am += grid[++a2][++b2];
    am -= grid[i1++][j1++];
    am += grid[++i2][++j2];
    x++;
    y++;
    x2++;
    y2++;
  }
}
void dodiag2(long long x, long long y, long long d) {
  long long x2 = x + d;
  long long y2 = y - d;
  long long a1 = x + d;
  long long b1 = y + d;
  long long a2 = a1 + d;
  long long b2 = b1 - d;
  long long i1 = x - d;
  long long j1 = y - d;
  long long i2 = i1 + d;
  long long j2 = j1 - d;
  long long am = 0;
  long long a = a1;
  long long b = b1;
  while (a < a2 && b > b2) {
    am += grid[a][b];
    a++;
    b--;
  }
  a = i1;
  b = j1;
  while (a < i2 && b > j2) {
    am += grid[a][b];
    a++;
    b--;
  }
  while (x2 <= 300 + n && y2 >= 300) {
    am -= grid[a1++][b1--];
    am -= grid[i1++][j1--];
    if (grid[x][y] && grid[x2][y2]) {
      ans += am;
    }
    am += grid[a2++][b2--];
    am += grid[i2++][j2--];
    x++;
    y--;
    x2++;
    y2--;
  }
}
int main() {
  scanf("%lld%lld", &n, &m);
  for (long long i = 300 + 1; i <= 300 + n; i++) {
    for (long long j = 300 + 1; j <= 300 + m; j++) {
      char a;
      scanf(" %c", &a);
      if (a == '#') grid[i][j] = 1;
    }
  }
  for (long long i = 300 + 1; i <= 300 + n; i++) {
    for (long long d = 1; d <= max(n, m); d++) dodiag1(i, 301, d);
  }
  for (long long i = 300 + 2; i <= 300 + m; i++) {
    for (long long d = 1; d <= max(n, m); d++) dodiag1(301, i, d);
  }
  for (long long i = 300 + 1; i <= 300 + n; i++) {
    for (long long d = 1; d <= max(n, m); d++) dodiag2(i, 300 + m, d);
  }
  for (long long i = 300 + 1; i < 300 + m; i++) {
    for (long long d = 1; d <= max(n, m); d++) dodiag2(301, i, d);
  }
  printf("%lld\n", ans);
}
