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 REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

int field[305][305];
int tmp[305][305];

ll sum[610][610];

int main(){
  int H, W;
  cin >> H >> W;
  rep(i,H){
    string s;
    cin >> s;
    rep(j,W){
      if(s[j] == '#'){
        field[i][j] = 1;
      }
    }
  }

  ll ret = 0;
  rep(k,4){
    rep(i,610){
      int y = i, x = 0;
      while(y >= 0){
        sum[i][x] = ((x==0)?0:sum[i][x-1]);
        if(0 <= y && y < 305 && 0 <= x && x < 305){
          if(field[y][x] == 1){
            sum[i][x]++; 
          }
        }
        y--;
        x++;
      }
      REP(j,x,610){
        sum[i][j] = sum[i][x-1];
      }
    }
    rep(i,305){
      rep(j,305){
        if(field[i][j] == 1){
          //cout << "\t" << i << " " << j << endl;
          int y = i-1, x = j+1;
          while(y >= 0){
            if((0<=y&&y<305&&0<=x&&x<305) && field[y][x] == 1){
              int dist = abs(x-j);

              int ay = i-dist, ax = j-dist;
              int by = y-dist, bx = x-dist;
              int z = ay + ax;
              //cout << "\t\t" << z << " " << ay << " " << ax << " " << by << " " << bx << endl;
              if(0 <= z){
                ll acnt = 0;
                if(0<=ax-1 && ax-1<610) acnt = sum[z][ax-1];
                if(610 <= ax-1) acnt = sum[z][609];
                ll bcnt = 0;
                if(0<=bx-1 && bx-1<610) bcnt = sum[z][bx-1];
                if(610 <= bx-1) bcnt = sum[z][609];
                ret += bcnt - acnt;
                //if(bcnt-acnt > 0) cout << i << " " << j << " " << y << " " << x << " " << bcnt-acnt << endl;
              }
            }
            y--;
            x++;
          }
        }
      }
    }

    rep(i,305){
      rep(j,305){
        tmp[j][304-i] = field[i][j];
      }
    }
    rep(i,305){
      rep(j,305){
        field[i][j] = tmp[i][j];
      }
    }

  }

  cout << ret << endl;
  
  return 0;
}