#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, c;
  cin >> r >> c;
  string s[r];
  for (int i = 0; i < r; i++) cin >> s[i];
  bool board[700][700] = {};
  for (int i = 0; i < c; i++) {
    for (int j = 0; j < r; j++) {
      board[i + j][i] = (s[j][i] == '#');
    }
  }
  long long int ans = 0;
  int psum[701][701] = {};
  for (int i = 0; i < 700; i++) {
    for (int j = 0; j < 700; j++) {
      psum[i][j + 1] = (board[i][j] ? 1 : 0);
    }
  }
  for (int i = 0; i < 700; i++) {
    for (int j = 0; j < 700; j++) psum[i][j + 1] += psum[i][j];
  }
  for (int i = 0; i < r + c - 1; i++) {
    for (int j = max(0, i - r + 1); j < i + 1; j++) {
      for (int k = j + 1; k < min(i + 1, c); k++) {
        if (board[i][j] && board[i][k]) {
          if (i >= 2 * (k - j)) {
            ans += psum[i - 2 * k + 2 * j][j + 1] -
                   psum[i - 2 * k + 2 * j][max(2 * j - k, 0)];
          }
          if ((i + 2 * k - 2 * j) < (r + c - 1)) {
            ans += psum[i + 2 * k - 2 * j][min(2 * k - j + 1, 700)] -
                   psum[i + 2 * k - 2 * j][k];
          }
        }
      }
    }
  }
  string ns[c];
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < c; j++) {
      ns[c - 1 - j] += s[i][j];
    }
  }
  board[700][700] = {};
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < c; j++) {
      board[i + j][i] = (ns[j][i] == '#');
    }
  }
  psum[701][701] = {};
  for (int i = 0; i < 700; i++) {
    for (int j = 0; j < 700; j++) {
      psum[i][j + 1] = (board[i][j] ? 1 : 0);
    }
  }
  for (int i = 0; i < 700; i++) {
    for (int j = 0; j < 700; j++) psum[i][j + 1] += psum[i][j];
  }
  for (int i = 0; i < r + c - 1; i++) {
    for (int j = max(0, i - c + 1); j < i + 1; j++) {
      for (int k = j + 1; k < min(i + 1, r); k++) {
        if (board[i][j] && board[i][k]) {
          if (i >= 2 * (k - j)) {
            ans += psum[i - 2 * k + 2 * j][j] -
                   psum[i - 2 * k + 2 * j][max(2 * j - k + 1, 0)];
          }
          if ((i + 2 * k - 2 * j) < (r + c - 1)) {
            ans += psum[i + 2 * k - 2 * j][min(2 * k - j, 700)] -
                   psum[i + 2 * k - 2 * j][k + 1];
          }
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
