#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
long long mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
long long llmax = 9223372036854775807;
long long llmin = -9223372036854775807;
int iinf = intmax / 8;
long long inf = llmax / 8;
double eps = 1e-11;
int h, w;
bool s[310][310];
int bo[610][610];
bool inmap(int x, int y) {
  if (x >= 0 && x < h && y >= 0 && y < w) {
    return true;
  } else {
    return false;
  }
}
int main() {
  cin >> h >> w;
  for (int i = 0; i < h; i++) {
    string ss;
    cin >> ss;
    for (int j = 0; j < w; j++) {
      if (ss[j] == '#') {
        s[i][j] = true;
      } else {
        s[i][j] = false;
      }
    }
  }
  for (int i = 0; i < 610; i++) {
    fill(bo[i], bo[i] + 610, 0);
  }
  int big = max(h, w);
  for (int i = -big; i < big; i++) {
    for (int j = 0; j < w; j++) {
      bo[i + h][j + 1] = bo[i + h][j];
      int x = i + j;
      int y = j;
      if (inmap(x, y)) {
        if (s[x][y]) {
          bo[i + h][j + 1]++;
        }
      }
    }
  }
  long long ans = 0;
  for (int i = -big; i < big; i++) {
    for (int j = 0; j < w; j++) {
      int firx = i + j;
      int firy = j;
      if (inmap(firx, firy)) {
        for (int k = 1; k < w; k++) {
          int secx = firx + k;
          int secy = firy + k;
          if (!inmap(secx, secy)) {
            break;
          }
          if (s[firx][firy] && s[secx][secy]) {
            int l = 2 * k;
            int boia = i - l;
            int boja = j + k;
            int bojb = min(j + 2 * k, w - 1);
            ans += bo[boia + h][bojb + 1] - bo[boia + h][boja];
            boia = i + l;
            boja = max(0, j - k);
            bojb = j;
            ans += bo[boia + h][bojb + 1] - bo[boia + h][boja];
          }
        }
      }
    }
  }
  for (int i = 0; i < 610; i++) {
    fill(bo[i], bo[i] + 610, 0);
  }
  for (int i = 0; i < 2 * big; i++) {
    for (int j = 0; j < w; j++) {
      bo[i][j + 1] = bo[i][j];
      int x = i - j;
      int y = j;
      if (inmap(x, y)) {
        if (s[x][y]) {
          bo[i][j + 1]++;
        }
      }
    }
  }
  for (int i = 0; i < 2 * big; i++) {
    for (int j = 0; j < w; j++) {
      int firx = i - j;
      int firy = j;
      if (inmap(firx, firy)) {
        for (int k = 1; k < w; k++) {
          int secx = firx - k;
          int secy = firy + k;
          if (!inmap(secx, secy)) {
            break;
          }
          if (s[firx][firy] && s[secx][secy]) {
            int l = 2 * k;
            int boia = i - l;
            int boja = max(j - k + 1, 0);
            int bojb = j - 1;
            ans += bo[boia][bojb + 1] - bo[boia][boja];
            boia = i + l;
            boja = j + k + 1;
            bojb = min(j + 2 * k - 1, w - 1);
            ans += bo[boia][bojb + 1] - bo[boia][boja];
          }
        }
      }
    }
  }
  cout << ans << endl;
}
