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;

using ll=long long;

const int N=305;

int n, m, s[3*N][3*N], t[3*N][3*N];
char b[3*N][3*N];
ll r;

int main(){
    scanf("%d%d", &n, &m);
    for(int i=0; i<n; i++) scanf("%s", b[i+N]+N);
    for(int i=0; i<6*N; i++) for(int x=i, y=0; y<3*N; x--, y++)
        if(0<=x&&x<3*N-1) s[x][y]=s[x+1][y-1]+(b[x][y]=='#');
    for(int i=-3*N; i<3*N; i++) for(int x=i, y=0; y<3*N; x++, y++)
        if(0<x&&x<3*N) t[x][y]=t[x-1][y-1]+(b[x][y]=='#');
    for(int i=N; i<=N+n+m-2; i++)
        for(int x=i, y=N; y<N+m; x--, y++) for(int z=x-1, w=y+1; w<N+m; z--, w++)
            if(b[x][y]=='#'&&b[z][w]=='#'){
                int u=w-y; r+=s[x][w+u]-s[x+u][w]+s[z-u+1][y-1]-s[z+1][y-u-1]; }
    for(int i=N-m+1; i<=N+n-1; i++)
        for(int x=i, y=N; y<N+m; x++, y++) for(int z=x+1, w=y+1; w<N+m; z++, w++)
            if(b[x][y]=='#'&&b[z][w]=='#'){
                int u=w-y; r+=t[z+u][y]-t[z][y-u]+t[x-1][w+u-1]-t[x-u-1][w-1]; }
    printf("%lld\n", r);
    return 0;
}