#include <bits/stdc++.h>
using namespace std;
int h, w;
string s[300];
bool f[300][300];
long ans, now;
int main() {
  cin >> h >> w;
  for (int i = 0; i < h; i++) {
    cin >> s[i];
    for (int j = 0; j < w; j++) f[i][j] = s[i][j] == '#';
  }
  for (int x = 1; x < h; x++)
    for (int y = 1; y < w; y++) {
      if ((x * 2 + y * 2) % 3) continue;
      int cnt = (x * 2 + y * 2) / 3;
      if (cnt < x || cnt < y) continue;
      now = 0;
      if (x == y * 2) {
        for (int i = 0; i < h - x; i++)
          for (int j = 0; j < w - y; j++)
            now += f[i][j] && f[i + x][j] && f[i + x / 2][j + y];
        for (int i = 0; i < h - x; i++)
          for (int j = y; j < w; j++)
            now += f[i][j] && f[i + x][j] && f[i + x / 2][j - y];
      } else if (y == x * 2) {
        for (int i = 0; i < h - x; i++)
          for (int j = 0; j < w - y; j++)
            now += f[i][j] && f[i][j + y] && f[i + x][j + y / 2];
        for (int i = x; i < h; i++)
          for (int j = 0; j < w - y; j++)
            now += f[i][j] && f[i][j + y] && f[i - x][j + y / 2];
      } else {
        for (int i = 0; i < h - x; i++)
          for (int j = 0; j < w - y; j++)
            now += f[i][j] && f[i + x][j + cnt - x] && f[i + cnt - y][j + y];
        for (int i = 0; i < h - x; i++)
          for (int j = y; j < w; j++)
            now += f[i][j] && f[i + x][j - cnt + x] && f[i + cnt - y][j - y];
        for (int i = x; i < h; i++)
          for (int j = 0; j < w - y; j++)
            now += f[i][j] && f[i - x][j + cnt - x] && f[i - cnt + y][j + y];
        for (int i = x; i < h; i++)
          for (int j = y; j < w; j++)
            now += f[i][j] && f[i - x][j - cnt + x] && f[i - cnt + y][j - y];
      }
      ans += now;
    }
  cout << ans << endl;
}
