#include <bits/stdc++.h>
using namespace std;
int h, w;
int H = 430, W = 430;
int a[310][310];
int b[2][450][450];
long long int bw[2][450][450], bh[2][450][450];
void convert() {
  int t = (w - 1) / 2;
  cout << t << endl;
  for (int x = int(0); x < int(w); ++x)
    for (int y = int(0); y < int(h); ++y)
      if ((x + y) % 2 == 0) {
        if (a[y][x] == 1) {
          b[0][(-x + y) / 2 + t + 1][(x + y) / 2 + 1] = 1;
          bw[0][(-x + y) / 2 + t + 1][(x + y) / 2 + 1] = 1;
          bh[0][(-x + y) / 2 + t + 1][(x + y) / 2 + 1] = 1;
        }
      } else {
        if (a[y][x] == 1) {
          b[1][(-x + 1 + y) / 2 + t][(x + 1 + y) / 2] = 1;
          bw[1][(-x + 1 + y) / 2 + t][(x + 1 + y) / 2] = 1;
          bh[1][(-x + 1 + y) / 2 + t][(x + 1 + y) / 2] = 1;
        }
      }
  for (int i = int(0); i < int(H); ++i)
    for (int j = int(0); j < int(W - 1); ++j)
      for (int k = int(0); k < int(2); ++k) {
        bw[k][i][j + 1] += bw[k][i][j];
      }
  for (int i = int(0); i < int(W); ++i)
    for (int j = int(0); j < int(H - 1); ++j)
      for (int k = int(0); k < int(2); ++k) {
        bh[k][j + 1][i] += bh[k][j][i];
      }
}
int main() {
  cin >> h >> w;
  string s;
  for (int i = int(0); i < int(h); ++i) {
    cin >> s;
    for (int j = int(0); j < int(w); ++j) {
      if (s[j] == '#') a[i][j] = 1;
    }
  }
  convert();
  long long int n = 0;
  for (int k = int(1); k < int(H); ++k) {
    for (int i = int(1); i < int(H); ++i) {
      for (int j = int(1); j < int(W); ++j) {
        if (j + k >= H) break;
        for (int l = int(0); l < int(2); ++l) {
          if (b[l][i][j] == 1 && b[l][i][j + k] == 1) {
            if (i - k >= 0) n += bw[l][i - k][j + k] - bw[l][i - k][j - 1];
            if (i + k < W) n += bw[l][i + k][j + k] - bw[l][i + k][j - 1];
          }
        }
      }
    }
  }
  for (int k = int(1); k < int(H); ++k) {
    for (int i = int(1); i < int(H); ++i) {
      for (int j = int(1); j < int(W); ++j) {
        if (i + k >= H) break;
        for (int l = int(0); l < int(2); ++l) {
          if (b[l][i][j] == 1 && b[l][i + k][j] == 1) {
            if (j - k >= 0) n += bh[l][i + k - 1][j - k] - bh[l][i][j - k];
            if (j + k < W) n += bh[l][i + k - 1][j + k] - bh[l][i][j + k];
          }
        }
      }
    }
  }
  cout << n << endl;
  return 0;
}
