Problem: There are some coins in the xy-plane. The positions of the coins are represented by a grid of characters with H rows and W columns. If the character at the i-th row and j-th column, s_{ij}, is `#`, there is one coin at point (i,j); if that character is `.`, there is no coin at point (i,j). There are no other coins in the xy-plane.

There is no coin at point (x,y) where 1\leq i\leq H,1\leq j\leq W does not hold. There is also no coin at point (x,y) where x or y (or both) is not an integer. Additionally, two or more coins never exist at the same point.

Find the number of triples of different coins that satisfy the following condition:

* Choosing any two of the three coins would result in the same Manhattan distance between the points where they exist.



Here, the Manhattan distance between points (x,y) and (x',y') is |x-x'|+|y-y'|. Two triples are considered the same if the only difference between them is the order of the coins.

Constraints

* 1 \leq H,W \leq 300
* s_{ij} is `#` or `.`.

Input

Input is given from Standard Input in the following format:


H W
s_{11}...s_{1W}
:
s_{H1}...s_{HW}


Output

Print the number of triples that satisfy the condition.

Examples

Input

5 4
#.##
.##.
#...
..##
...#


Output

3


Input

5 4
.##
.##.
...
..##
...#


Output

3


Input

13 27
......#.........#.......#..
...#.....###..
..............#####...##...
...#######......#...#######
...#.....#.....###...#...#.
...#######....#.#.#.#.###.#
..............#.#.#...#.#..
.#.#.#...###..
...........#...#...#######
..#######..#...#...#.....#
..#.....#..#...#...#.###.#
..#######..#...#...#.#.#.#
..........##...#...#.#####


Output

870

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#define REP(i, a, n) for (ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

vector<vector<char>> rotate(ll H, ll W, const vector<vector<char>> &S) {
  const ll INF = 1LL << 60;
  ll miny = INF, minx = INF, maxy = -INF, maxx = -INF;
  vector<pair<ll, ll>> p;
  REP(i, 0, H) REP(j, 0, W) {
    if (S[i][j] == '#') {
      ll y = j + i, x = j - i;
      p.push_back(make_pair(y, x));
      miny = min(miny, y);
      minx = min(minx, x);
      maxy = max(maxy, y);
      maxx = max(maxx, x);
    }
  }

  ll h = p.size() > 0 ? maxy - miny + 1 : 1;
  ll w = p.size() > 0 ? maxx - minx + 1 : 1;
  vector<vector<char>> s(h, vector<char>(w, '.'));
  REP(i, 0, p.size()) {
    s[p[i].first - miny][p[i].second - minx] = '#';
  }
  return s;
}

int main(void) {
  ll H, W;
  cin >> H >> W;
  vector<vector<char>> S(H, vector<char>(W));
  REP(i, 0, H) REP(j, 0, W) cin >> S[i][j];

  S = rotate(H, W, S);
  H = S.size();
  W = S[0].size();

  vector<vector<ll>> row(H, vector<ll>(W + 1));
  REP(i, 0, H) REP(j, 0, W) row[i][j + 1] = row[i][j] + (S[i][j] == '#' ? 1 : 0);

  vector<vector<ll>> col(W, vector<ll>(H + 1));
  REP(i, 0, W) REP(j, 0, H) col[i][j + 1] = col[i][j] + (S[j][i] == '#' ? 1 : 0);

  ll ans = 0, ans2 = 0;
  REP(i, 0, H) REP(j, 0, W) if (S[i][j] == '#') {
    REP(x, j + 1, W) if (S[i][x] == '#') {
      ll t = x - j;
      if (0 <= i - t && i - t < H) {
        ans += row[i - t][x + 1] - row[i - t][j];
        if (S[i - t][x] == '#') ans2++;
        if (S[i - t][j] == '#') ans2++;
      }
      if (0 <= i + t && i + t < H) {
        ans += row[i + t][x + 1] - row[i + t][j];
        if (S[i + t][x] == '#') ans2++;
        if (S[i + t][j] == '#') ans2++;
      }
    }
    REP(y, i + 1, H) if (S[y][j] == '#') {
      ll t = y - i;
      if (0 <= j - t && j - t < W) {
        ans += col[j - t][y + 1] - col[j - t][i];
        if (S[y][j - t] == '#') ans2++;
        if (S[i][j - t] == '#') ans2++;
      }
      if (0 <= j + t && j + t < W) {
        ans += col[j + t][y + 1] - col[j + t][i];
        if (S[y][j + t] == '#') ans2++;
        if (S[i][j + t] == '#') ans2++;
      }
    }
  }
  cout << ans - ans2 / 2 << endl;
}