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>

using namespace std;

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL 9223372036854775
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define MOD 10000
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

#define int long long

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a)  begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

const int MAX_H = 310;
const int MAX_W = 310;

const int MAX_T = MAX_H*2;

int H, W;
char Field[MAX_H][MAX_W];

int T_Field[MAX_T][MAX_T];
int T_Sum[MAX_T][MAX_T];
int T_SumW[MAX_T][MAX_T];
int T_SumH[MAX_T][MAX_T];

int getT(int sx, int sy, int gx, int gy) {
  return T_Sum[gy][gx] - T_Sum[gy][sx] - T_Sum[sy][gx] + T_Sum[sy][sx];
}

signed main() {
  cin >> H >> W;
  REP(y,H) {
    REP(x,W) {
      cin >> Field[y][x];
      if(Field[y][x] == '#') {
        T_Field[x+y+2][y-x+MAX_W] = T_SumH[x+y+2][y-x+MAX_W] = T_SumW[x+y+2][y-x+MAX_W] =1;
      }
    }
  }

  REP(y,MAX_T-1) {
    REP(x,MAX_T-1) {
      T_SumH[y+1][x] += T_SumH[y][x];
      T_SumW[y][x+1] += T_SumW[y][x];
    }
  }

  REP(y,MAX_T-1) {
    REP(x,MAX_T-1) {
      T_Sum[y+1][x+1] = T_Sum[y+1][x] + T_Sum[y][x+1] - T_Sum[y][x] + T_Field[y][x];
    }
  }

  int ans = 0;
  REP(y,MAX_T) {
    REP(x,MAX_T) {
      if(T_Field[y][x] == 0) {
        continue;
      }
      FOR(nx,x+1,MAX_T) {
        int d = nx - x;
        if(T_Field[y][nx] == 0) {
          continue;
        }
        if(0 <= y-d) {
          ans += T_SumW[y-d][nx] - T_SumW[y-d][x-1];
          // ans += getT(x,y-d,nx+1,y-d+1);
        }
        if(y+d < MAX_T) {
          ans += T_SumW[y+d][nx] - T_SumW[y+d][x-1];
          // ans += getT(x,y+d,nx+1,y+d+1);
        }
      }
      FOR(ny,y+1,MAX_T) {
        int d = ny - y;
        if(T_Field[ny][x] == 0) {
          continue;
        }
        if(0 <= x-d) {
          ans += T_SumH[ny-1][x-d] - T_SumH[y][x-d];
          // ans += getT(x-d, y+1, x-d+1, ny);
        }
        if(x+d < MAX_T) {
          ans += T_SumH[ny-1][x+d] - T_SumH[y][x+d];
          // ans += getT(x+d, y+1, x+d+1, ny);
        }
      }
    }
  }

  cout << ans << endl;

  return 0;
}