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;
#define iinf 2000000000
#define linf 1000000000000000000LL
#define ulinf 10000000000000000000ull
#define MOD1 1000000007LL
#define mpr make_pair
typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned long UL;
typedef unsigned short US;
typedef pair < int , int > pii;
clock_t __stt;
inline void TStart(){__stt=clock();}
inline void TReport(){printf("\nTaken Time : %.3lf sec\n",(double)(clock()-__stt)/CLOCKS_PER_SEC);}
template < typename T > T MIN(T a,T b){return a<b?a:b;}
template < typename T > T MAX(T a,T b){return a>b?a:b;}
template < typename T > T ABS(T a){return a>0?a:(-a);}
template < typename T > void UMIN(T &a,T b){if(b<a) a=b;}
template < typename T > void UMAX(T &a,T b){if(b>a) a=b;}
int n,m,sl[605][605],sc[605][605],N;
bool g[605][605];
LL res;
bool readch(){
	char c=getchar();
	while(c==' '||c=='\n') c=getchar();
	return (c=='#');
}
int main(){
    // inputting start
    // 数据结构记得初始化！ n，m别写反！
    int i,j,k;
	scanf("%d%d",&n,&m);
	for(i=0;i<n;++i){
		for(j=0;j<m;++j){
			g[i+j][i-j+m-1]=readch();
		}
	}
    #ifdef LOCAL
        TStart();
    #endif
    // calculation start
    // 数据结构记得初始化！ n，m别写反！
	N=n+m-1;
	for(i=0;i<N;++i){
		for(j=0;j<N;++j){
			sl[i][j]=sc[i][j]=g[i][j];
			if(j) sl[i][j]+=sl[i][j-1];
			if(i) sc[i][j]+=sc[i-1][j];
		}
	}
    for(i=0;i<N;++i){
		for(j=0;j<N;++j){
			if(g[i][j]) for(k=j+1;k<N;++k){
				if(g[i][k]){
					int d=k-j;
					if(i+d<N) res+=(LL)sl[i+d][k];
					if(i+d<N && j) res-=(LL)sl[i+d][j-1];
					if(i>=d) res+=(LL)sl[i-d][k];
					if(i>=d && j) res-=(LL)sl[i-d][j-1];
				}
			}
		}
	}
	for(i=0;i<N;++i){
		for(j=0;j<N;++j){
			if(g[j][i]) for(k=j+1;k<N;++k){
				if(g[k][i]){
					int d=k-j;
					if(i+d<N) res+=(LL)sc[k-1][i+d];
					if(i+d<N) res-=(LL)sc[j][i+d];
					if(i>=d) res+=(LL)sc[k-1][i-d];
					if(i>=d) res-=(LL)sc[j][i-d];
				}
			}
		}
	}
	printf("%lld\n",res);
    #ifdef LOCAL
        TReport();
    #endif
    return 0;
}