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<iostream>
using namespace std;
char St[305];
int n,m,i,j,S[605][605],A[605][605],k,rez,sum;

int nr(int i1, int j1, int i2, int j2)
{
    i1--;
    j1--;
    i1=max(i1,0);
    i2=max(i2,0);
    j2=max(j2,0);
    j1=max(j1,0);
    i1=min(i1,n);
    i2=min(i2,n);
    j2=min(j2,n);
    j1=min(j1,n);
    if(i1>i2 || j1>j2)
        return 0;
    return (S[i2][j2]-S[i1][j2]-S[i2][j1]+S[i1][j1]);
}

int main()
{
    ios::sync_with_stdio(false);
    cin>>n>>m;
    for(i=1; i<=n; i++)
    {
        cin>>St;
        for(j=1; j<=m; j++)
            A[i-j+m][i+j]=(St[j-1]=='#');
    }
    n+=m;
    for(i=0; i<=n; i++)
        for(j=0; j<=n; j++)
        {
            sum=A[i][j];
            if(i>=1)
                sum+=S[i-1][j];
            if(j>=1)
                sum+=S[i][j-1];
            if(i>=1 && j>=1)
                sum-=S[i-1][j-1];
            S[i][j]=sum;
        }
    for(i=0; i<=n; i++)
        for(j=2; j<=n; j++)
            if(A[i][j])
            {
                for(k=j+2; k<=n; k+=2)
                    if(A[i][k])
                    {
                        rez=rez+nr(i+(k-j),j,i+(k-j),k);
                        rez=rez+nr(i-(k-j),j,i-(k-j),k);
                    }
                for(k=i+2; k<=n; k+=2)
                    if(A[k][j])
                    {
                        rez=rez+nr(i+1,j+(k-i),k-1,j+(k-i));
                        rez=rez+nr(i+1,j-(k-i),k-1,j-(k-i));
                    }
            }
    cout<<rez<<"\n";
    return 0;
}