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>
#define ll long long
using namespace std;
const int maxn = 1000+110;

int H, W;
vector<int>r[maxn], c[maxn];
int sum[maxn][maxn];
ll ans;
char s[maxn][maxn];

int solve1(int x,int y1, int y2)
{
    if(x<1 || x>H+W) return 0;
    return sum[x][y2]-sum[x-1][y2]-sum[x][y1-1]+sum[x-1][y1-1];
}

int solve2(int y, int x1, int x2)
{
    if(y<1 || y>H+W) return 0;
    if(x1>x2) return 0;
    return sum[x2][y] - sum[x1 - 1][y] - sum[x2][y - 1] + sum[x1 - 1][y - 1];
}

int main()
{
    scanf("%d%d", &H, &W);
    for(int i=1;i<=H;i++)
    {
        scanf("%s", s[i]+1);
        for(int j=1;j<=W;j++)
        {
            if(s[i][j]=='#')
            {
                sum[i+j][i-j+W]++;
                r[i+j].push_back(i-j+W);
                c[i-j+W].push_back(i+j);
            }
        }
    }
    for(int i=1;i<=H+W;i++)
    {
        for(int j=1;j<=H+W;j++)
        {
            sum[i][j]+=sum[i-1][j]+sum[i][j-1]-sum[i-1][j-1];
        }
    }
    ll ans=0;
    for(int i=1;i<=H+W;i++)
    {
        sort(r[i].begin(), r[i].end());
        for(int j=0;j<int(r[i].size());j++)
        {
            for(int k=j+1; k<int(r[i].size());k++)
            {
                int l=r[i][k]-r[i][j];
                ans += solve1(i-l, r[i][j], r[i][k]);
                ans += solve1(i+l, r[i][j], r[i][k]);
            }
        }
    }
    for(int i=1;i<=H+W;i++)
    {
        sort(c[i].begin(), c[i].end());
        for(int j=0;j<int(c[i].size());j++)
        {
            for(int k=j+1;k<int(c[i].size());k++)
            {
                int l=c[i][k]-c[i][j];
                ans += solve2(i-l, c[i][j]+1, c[i][k]-1);
                ans += solve2(i+l, c[i][j]+1, c[i][k]-1);
            }
        }
    }
    printf("%lld\n", ans);

}