#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int ret = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  do {
    ret = ret * 10 + ch - '0';
    ch = getchar();
  } while ('0' <= ch && ch <= '9');
  return ret;
}
inline void write(int x) {
  if (!x) return;
  write(x / 10);
  putchar(x % 10 + '0');
}
int n, m;
int a[310][310];
int s1[310][310], s2[310][310];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  string s;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    for (int j = 1; j <= n; j++) a[i][j] = s[j - 1] == '#';
  }
  for (int i = 2; i <= 2 * n; i++)
    for (int j = max(1, i - n); j <= min(n, i - 1); j++)
      s1[j][i - j] = s1[j - 1][i - (j - 1)] + a[j][i - j];
  for (int i = -(n - 1); i <= n - 1; i++)
    for (int j = max(1, 1 - i); j <= min(n, n - i); j++)
      s2[j][i + j] = s2[j - 1][i + (j - 1)] + a[j][i + j];
  int Ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      for (int k = 1; k <= n; k++) {
        if (i - k > 0 && j - k > 0 && a[i][j - k] && a[i - k][j]) {
          int d = i + j + k;
          Ans += s1[d - j - 1][d - (d - j - 1)] - s1[i][d - i];
        }
        if (i + k <= n && j + k <= n && a[i + k][j] && a[i][j + k]) {
          int d = i + j - k;
          Ans += s1[i - 1][d - (i - 1)] - s1[d - j][d - (d - j)];
        }
        if (i - k > 0 && j + k <= n && a[i - k][j] && a[i][j + k]) {
          int d = j - i - k;
          Ans += s2[j - d - 1][d + (j - d - 1)] - s2[i][d + i];
        }
        if (i + k <= n && j - k > 0 && a[i + k][j] && a[i][j - k]) {
          int d = j - i + k;
          Ans += s2[i - 1][d + (i - 1)] - s2[j - d][d + (j - d)];
        }
        int tot = 0;
        if (i - k > 0 && a[i - k][j]) tot++;
        if (j - k > 0 && a[i][j - k]) tot++;
        if (i + k <= n && a[i + k][j]) tot++;
        if (j + k <= n && a[i][j + k]) tot++;
        if (tot == 3)
          Ans++;
        else if (tot == 4)
          Ans += 4;
      }
    }
  }
  cout << Ans << endl;
  return 0;
}
