#include <bits/stdc++.h>
using namespace std;
struct Point {
  int r, c;
  Point(int r = 0, int c = 0) : r(r), c(c) {}
  Point operator+(Point r) { return Point(this->r + r.r, this->c + r.c); }
  void operator+=(Point r) {
    this->r += r.r;
    this->c += r.c;
  }
  Point operator*(int a) { return Point(r * a, c * a); }
  bool operator==(Point r) { return this->r == r.r && this->c == r.c; }
  bool operator!=(Point r) { return !(*this == r); }
};
Point dir[4] = {Point(-2, 0), Point(-1, 1), Point(0, -2), Point(1, -1)};
Point dir2[4] = {Point(-2, 0), Point(-1, -1), Point(0, 2), Point(1, 1)};
int H, W;
bool outOfRange(Point p) { return p.r < 0 || p.r >= H || p.c < 0 || p.c >= W; }
int main() {
  vector<Point> coins;
  cin >> H >> W;
  vector<vector<int>> GRID(H, vector<int>(W));
  for (int i = 0; i < H; i++)
    for (int j = 0; j < W; j++) {
      char c;
      cin >> c;
      if (c == '#') {
        GRID[i][j] = 1;
        coins.push_back(Point(i, j));
      }
    }
  int ans = 0;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (GRID[i][j]) {
        Point p(i + 1, j + 1);
        while (!outOfRange(p)) {
          if (GRID[p.r][p.c]) {
            Point np = p + dir[0] * (p.r - i);
            Point np2 = p + dir[1] * (p.r - i);
            while (1) {
              if (outOfRange(np)) {
              } else {
                if (GRID[np.r][np.c]) {
                  ans++;
                }
              }
              if (np == np2) break;
              np.r++;
              np.c++;
            }
            np = p + dir[2] * (p.r - i);
            np2 = p + dir[3] * (p.r - i);
            while (1) {
              if (outOfRange(np)) {
              } else {
                if (GRID[np.r][np.c]) {
                  ans++;
                }
              }
              if (np == np2) break;
              np.r++;
              np.c++;
            }
          }
          p.r++;
          p.c++;
        }
      }
    }
  }
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (GRID[i][j]) {
        Point p(i + 1, j - 1);
        while (!outOfRange(p)) {
          if (GRID[p.r][p.c]) {
            Point np = p + dir2[0] * (p.r - i);
            Point np2 = p + dir2[1] * (p.r - i);
            np.r++;
            np.c--;
            while (1) {
              if (np == np2) break;
              if (outOfRange(np)) {
              } else {
                if (GRID[np.r][np.c]) {
                  ans++;
                }
              }
              np.r++;
              np.c--;
            }
            np = p + dir2[2] * (p.r - i);
            np2 = p + dir2[3] * (p.r - i);
            np.r++;
            np.c--;
            while (1) {
              if (np == np2) break;
              if (outOfRange(np)) {
              } else {
                if (GRID[np.r][np.c]) {
                  ans++;
                }
              }
              np.r++;
              np.c--;
            }
          }
          p.r++;
          p.c--;
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
