#include <bits/stdc++.h>
using namespace std;
const int N = 310;
int s[N][N], n, m;
char ch[N];
long long Ans;
struct Point {
  int x, y;
  int operator<(const Point& A) const {
    if (A.x != x)
      return A.x < x;
    else
      return A.y < y;
  }
  int operator==(const Point& A) const { return A.x == x && A.y == y; }
};
struct MMP {
  Point P1, P2, P3;
  int operator<(const MMP& A) const {
    if (!(P1 == A.P1)) return P1 < A.P1;
    if (!(P2 == A.P2)) return P2 < A.P2;
    if (!(P3 == A.P3)) return P3 < A.P3;
    return 0;
  }
};
map<MMP, int> Map;
int cmp(const Point& A, const Point& B) {
  if (A.x != B.x)
    return A.x < B.x;
  else
    return A.y < B.y;
}
int Yes(int x, int y) {
  if (x > n || y > m || x < 1 || y < 1) return 0;
  return s[x][y];
}
void Get(int a, int b, int x, int y, int i, int j, int id) {
  Point P[4];
  P[1] = (Point){a, b};
  P[2] = (Point){i, j};
  P[3] = (Point){x, y};
  sort(P + 1, P + 4, cmp);
  MMP Now = (MMP){P[1], P[2], P[3]};
  Map[Now] = 1;
  if (P[1].x == 1 && P[1].y == 3 && P[2].x == 3 && P[2].y == 1 && P[3].x == 4 &&
      P[3].y == 6)
    printf("id=%d,a=%d,b=%d,x=%d,y=%d,i=%d,j=%d\n", id, a, b, x, y, i, j);
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    scanf("%s", ch + 1);
    for (int j = 1; j <= m; j++) s[i][j] = ch[j] == '#';
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (s[i][j]) {
        for (int k = 1; Yes(i + 2 * k, j); k++) {
          if (Yes(i + k, j + k))
            Get(i, j, i + 2 * k, j, i + k, j + k, 1), Ans++;
          if (Yes(i + k, j - k))
            Get(i, j, i + 2 * k, j, i + k, j - k, 2), Ans++;
        }
        for (int k = 1; Yes(i, j + 2 * k); k++) {
          if (Yes(i + k, j + k))
            Get(i, j, i, j + 2 * k, i + k, j + k, 3), Ans++;
          if (Yes(i - k, j + k))
            Get(i, j, i, j + 2 * k, i - k, j + k, 4), Ans++;
        }
        for (int k = 1; Yes(i - 2 * k, j - 2 * k); k++) {
          if (Yes(i - 3 * k, j + k))
            Get(i, j, i - 2 * k, j - 2 * k, i - 3 * k, j + k, 5), Ans++;
          if (Yes(i + k, j - 3 * k))
            Get(i, j, i - 2 * k, j - 2 * k, i + k, j - 3 * k, 6), Ans++;
        }
        for (int k = 1; Yes(i + 2 * k, j - 2 * k); k++) {
          if (Yes(i - k, j - 3 * k))
            Get(i, j, i + 2 * k, j - 2 * k, i - k, j - 3 * k, 7), Ans++;
          if (Yes(i + 3 * k, j + k))
            Get(i, j, i + 2 * k, j - 2 * k, i + 3 * k, j + k, 8), Ans++;
        }
        for (int k = 3; Yes(i + k, j - k); k += 2) {
          if (Yes(i + k + k / 2, j + (k + 1) / 2))
            Get(i, j, i + k, j - k, i + k + k / 2, j + (k + 1) / 2, 11), Ans++;
          if (Yes(i + k + (k + 1) / 2, j + k / 2))
            Get(i, j, i + k, j - k, i + (k + 1) / 2 + k, j + k / 2, 12), Ans++;
          if (Yes(i - k / 2, j - k - (k + 1) / 2))
            Get(i, j, i + k, j - k, i - k / 2, j - k - (k + 1) / 2, 13), Ans++;
          if (Yes(i - (k + 1) / 2, j - k - k / 2))
            Get(i, j, i + k, j - k, i - (k + 1) / 2, j - k - k / 2, 14), Ans++;
        }
        for (int k = 3; Yes(i + k, j + k); k += 2) {
          if (Yes(i - (k + 1) / 2, j + k + k / 2))
            Get(i, j, i + k, j + k, i - (k + 1) / 2, j + k + k / 2, 15), Ans++;
          if (Yes(i - k / 2, j + k + (k + 1) / 2))
            Get(i, j, i + k, j + k, i - k / 2, j + k + (k + 1) / 2, 16), Ans++;
          if (Yes(i + k + k / 2, j - (k + 1) / 2))
            Get(i, j, i + k, j + k, i + k + k / 2, j - (k + 1) / 2, 17), Ans++;
          if (Yes(i + k + (k + 1) / 2, j - k / 2))
            Get(i, j, i + k, j + k, i + k + (k + 1) / 2, j - k / 2, 18), Ans++;
        }
      }
  cout << Ans << endl;
}
