#include <bits/stdc++.h>
using namespace std;
int n, m, tot, sum[1200][1200];
int a[320][320];
int b[320][320];
char s[320];
long long ans;
int cal() {
  memset(sum, 0, sizeof(sum));
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) sum[i + j][j] = a[i][j];
  for (int i = 1; i <= n + m; i++)
    for (int j = 1; j <= m; j++) sum[i][j] += sum[i][j - 1];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      for (int k = 1; k <= min(i - 1, j - 1); k++) {
        if (a[i][j - k] && a[i - k][j])
          ans += sum[i + j + k][min(j + k, m)] - sum[i + j + k][j - 1];
      }
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      for (int k = 2; i + k - 1 <= n && j + k - 1 <= m && j - k + 1 >= 1; k++)
        if (a[i][j - k + 1] && a[i][j + k - 1] && a[i + k - 1][j]) ans--;
}
int main() {
  freopen("1.in", "r", stdin);
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s + 1);
    for (int j = 1; j <= m; j++) a[i][j] = s[j] == '#';
  }
  cal();
  memset(b, 0, sizeof(b));
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) b[j][n - i + 1] = a[i][j];
  memcpy(a, b, sizeof(b));
  swap(n, m);
  cal();
  memset(b, 0, sizeof(b));
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) b[j][n - i + 1] = a[i][j];
  memcpy(a, b, sizeof(b));
  swap(n, m);
  cal();
  memset(b, 0, sizeof(b));
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) b[j][n - i + 1] = a[i][j];
  memcpy(a, b, sizeof(b));
  swap(n, m);
  cal();
  printf("%d\n", ans);
}
