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;

template <typename T> void chmin(T&x,const T &y)
{
	if(x>y)x=y;
}
template <typename T> void chmax(T &x,const T &y)
{
	if(x<y)x=y;
}
typedef long long s64;
typedef unsigned long long u64;
typedef unsigned int u32;
typedef pair<int,int> pii;
#define rep(i,l,r) for(int i=l;i<=r;++i)
#define per(i,r,l) for(int i=r;i>=l;--i)
#define rep0(i,l,r) for(int i=l;i<r;++i)
#define gc (c=getchar())
int read()
{
	char c;
	while(gc<'-');
	if(c=='-')
	{
		int x=gc-'0';
		while(gc>='0')x=x*10+c-'0';
		return -x;
	}
	int x=c-'0';
	while(gc>='0')x=x*10+c-'0';
	return x;
}
#undef gc

const int N=600+5;
int n,m;
char s[N][N];
bool b[N][N];
int left_s[N][N],up_s[N][N],left_s1[N][N];

int main()
{
#ifdef kcz
	freopen("1.in","r",stdin);//freopen("1.out","w",stdout);
#endif
	cin>>n>>m;
	rep(i,1,n)scanf("%s",s[i]+1);
	rep(i,1,n)
	rep(j,1,m)b[i+m-j][i+j]=s[i][j]=='#';
	rep(i,1,N-1)
	rep(j,1,N-1)
	{
		left_s[i][j]=left_s[i][j-1]+b[i][j];
		up_s[i][j]=up_s[i-1][j]+b[i][j];
	}
	s64 ans=0;
	rep(k,1,n-1+m-1)
	{
		rep(i,1,N-1)
		rep(j,1,N-1)left_s1[i][j]=left_s1[i][j-1]+(j>=k&&b[i][j]&&b[i][j-k]);
		rep(i,1,n)
		rep(j,1,m)
		if(s[i][j]=='#')
		{
			int x=i+m-j,y=i+j;
			if(x<=k)continue;
			if(y>k&&b[x][y-k])ans+=left_s[x-k][y]-left_s[x-k][y-k-1];
			if(b[x-k][y])
			{
				if(y>k)ans+=up_s[x-1][y-k]-up_s[x-k][y-k];
				if(y+k<N)ans+=up_s[x-1][y+k]-up_s[x-k][y+k];
			}
			ans+=left_s1[x-k][min(N-1,y+k)]-left_s1[x-k][y-1];
		//	if(y+k<N&&b[x][y+k])ans+=left_s[x-k][y+k]-left_s[x-k][y-1];
		}
	}
	cout<<ans;
}