#include <bits/stdc++.h>
using namespace std;
const long long N = 305;
char ss[N][N];
long long n, m;
long long f[N][N][1205];
long long g[N][N][1205];
long long calc(long long x1, long long y1, long long x2, long long y2,
               long long d) {
  if (x1 > x2) return 0;
  if (y1 > y2) return 0;
  return f[x2][y2][d + 600] - f[x2][y1 - 1][d + 600] - f[x1 - 1][y2][d + 600] +
         f[x1 - 1][y1 - 1][d + 600];
}
long long calc1(long long x1, long long y1, long long x2, long long y2,
                long long d) {
  if (x1 > x2) return 0;
  if (y1 > y2) return 0;
  return g[x2][y2][d + 600] - g[x2][y1 - 1][d + 600] - g[x1 - 1][y2][d + 600] +
         g[x1 - 1][y1 - 1][d + 600];
}
bool check(long long x, long long y) {
  return x <= n && y <= m && x >= 1 && y >= 1 && ss[x][y] == '#';
}
int main() {
  scanf("%lld%lld", &n, &m);
  for (long long u = 1; u <= n; u++) scanf("%s", ss[u] + 1);
  for (long long u = 1; u <= n; u++)
    for (long long i = 1; i <= m; i++) {
      for (long long j = 1; j <= 1200; j++) {
        f[u][i][j] =
            f[u][i][j] + f[u][i - 1][j] + f[u - 1][i][j] - f[u - 1][i - 1][j];
        g[u][i][j] =
            g[u][i][j] + g[u][i - 1][j] + g[u - 1][i][j] - g[u - 1][i - 1][j];
      }
      if (ss[u][i] == '#') {
        f[u][i][u + i + 600]++;
        g[u][i][u - i + 600]++;
      }
    }
  long long ans = 0;
  for (long long u = 1; u <= n; u++)
    for (long long i = 1; i <= m; i++) {
      for (long long d = 1; d <= min(n, m); d++) {
        if (check(u, i + d) && check(u + d, i))
          ans = ans + calc(1, 1, u, i, u + i - d);
        if (check(u, i - d) && check(u + d, i)) {
          ans = ans + calc1(1, i, u, m, u - i - d);
        }
        if (check(u, i + d) && check(u - d, i)) {
          ans = ans + calc1(u, 1, n, i, d + u - i);
        }
        if (check(u, i - d) && check(u - d, i))
          ans = ans + calc(u, i, n, m, d + u + i);
        long long cnt = 0;
        cnt = cnt + check(u, i + d) + check(u + d, i) + check(u - d, i) +
              check(u, i - d);
        if (cnt == 4) ans = ans - 4;
        if (cnt == 3) ans--;
      }
    }
  printf("%lld\n", ans);
  return 0;
}
