#include <bits/stdc++.h>
using namespace std;
string board[330];
long long int w, h;
long long int dx[] = {1, 1, -1};
long long int dy[] = {0, 1, 1};
long long int d[] = {1, 2, 2};
int main() {
  cin >> h >> w;
  for (long long int i = 0; i < ((long long int)(h)); i++) {
    cin >> board[i];
  }
  long long int res = 0;
  for (long long int i = 0; i < ((long long int)(h)); i++) {
    for (long long int j = 0; j < ((long long int)(w)); j++) {
      if (board[i][j] != '#') {
        continue;
      }
      for (long long int k = 2; j + k < w; k += 2) {
        if (board[i][j + k] != '#') {
          continue;
        }
        if (i - k / 2 >= 0 && board[i - k / 2][j + k / 2] == '#') {
          ++res;
        }
        if (i + k / 2 < h && board[i + k / 2][j + k / 2] == '#') {
          ++res;
        }
      }
      for (long long int k = 2; i + k < h; k += 2) {
        if (board[i + k][j] != '#') {
          continue;
        }
        if (j + k / 2 < w && board[i + k / 2][j + k / 2] == '#') {
          ++res;
        }
        if (j - k / 2 >= 0 && board[i + k / 2][j - k / 2] == '#') {
          ++res;
        }
      }
      for (long long int k = 2; j + k < w; k += 2) {
        if (i + k >= h) {
          break;
        }
        if (board[i + k][j + k] != '#') {
          continue;
        }
        if (i + k + k / 2 < h && j - k / 2 >= 0 &&
            board[i + k + k / 2][j - k / 2] == '#') {
          ++res;
        }
        if (i - k / 2 >= 0 && j + k + k / 2 < w &&
            board[i - k / 2][j + k + k / 2] == '#') {
          ++res;
        }
      }
      for (long long int k = 2; k <= j; k += 2) {
        if (i + k >= h) {
          break;
        }
        if (board[i + k][j - k] != '#') {
          continue;
        }
        if (i + k + k / 2 < h && j + k / 2 >= 0 &&
            board[i + k + k / 2][j + k / 2] == '#') {
          ++res;
        }
        if (i - k / 2 >= 0 && j - k - k / 2 < w &&
            board[i - k / 2][j - k - k / 2] == '#') {
          ++res;
        }
      }
    }
  }
  cout << res << endl;
  return 0;
}
