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<cstdio>
char s[305][305];
int sum0[605][605], sum1[605][605];

int getSum0(int i,int l,int r,int n,int m){
    if(i<=0 || i>=n+m) return 0;
    else if(l>r) return 0; 
    else return sum0[i][r]-sum0[i][l-1];
}

int getSum1(int i,int l,int r,int n,int m){
    if(i<=1 || i>=n+m+1) return 0;
    else if(l>r) return 0;
    else return sum1[i][r]-sum1[i][l-1];
}

int main(){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i = 1; i <= n; i++){
        scanf("%s",s[i]+1);
        for(int j = 1; j <= m; j++){
            if(s[i][j]=='#'){
                sum0[i-j+m][i+j] = 1;
                sum1[i+j][i-j+m] = 1;
            }
        }
    }
    for(int i = 1; i <= n+m-1; i++){
        sum0[i][0] = 0;
        for(int j = 1; j <= n+m; j++) sum0[i][j] += sum0[i][j-1];
    }
    for(int i = 2; i <= n+m; i++){
        sum1[i][0] = 0;
        for(int j = 1; j <= n+m-1; j++) sum1[i][j] += sum1[i][j-1];
    }
    long long ans = 0;
    for(int i = 1; i <= n+m-1; i++){
        for(int j = 2; j <=n+m; j++){
            if(sum0[i][j]==sum0[i][j-1]) continue;
            for(int k = 2; k < j; k++){
                if(sum0[i][k]==sum0[i][k-1]) continue;
                //printf("i = %d, j = %d, k = %d\n",i,j,k);
                int diff = j-k;
                //printf("diff = %d\n",diff);
                long long add = getSum0(i+diff,k,j,n,m)+getSum0(i-diff,k,j,n,m);
                ans += add;
            }
        }
    }
    for(int i = 2; i <= n+m; i++){
        for(int j = 1; j <=n+m-1; j++){
            if(sum1[i][j]==sum1[i][j-1]) continue;
            for(int k = 1; k < j; k++){
                if(sum1[i][k]==sum1[i][k-1]) continue;
                int diff = j-k;
                long long add = getSum1(i+diff,k+1,j-1,n,m)+getSum1(i-diff,k+1,j-1,n,m);
                ans += add;
            }
        }
    }
    printf("%lld\n",ans);
    return 0;
}