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<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<complex>
#define lol(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
typedef long long ll;

using namespace std;
#define M 310
#define N 620
ll h,w;
string s[N];
bool t[N][N];

ll cs[N][N];
void Init(){
    lol(i,N-1){
	cs[i][0]=0;
	lol(j,N-1)cs[i][j+1]=cs[i][j]+t[i][j];
    }
}
ll Sum(ll y,ll a,ll b){
    if(y<0||y>=N)return 0;
    return cs[y][b+1]-cs[y][a];
}
ll Solve(){
    lol(i,N)for(int j=i+1;j<N;j++)swap(t[i][j],t[j][i]);
    Init();//cout<<"%"<<endl;
    ll ans=0;
    lol(i,N-1){
	lol(a,N)for(int b=a+1;b<N-1;b++){
	    if(!(t[i][a]==1&&t[i][b]==1))continue;
	    ll d=b-a;
	    ans+=Sum(i-d,a,b);
	    ans+=Sum(i+d,a,b);
	}
    }
    return ans;
}


int main(){
    cin>>h>>w;
    lol(i,h)cin>>s[i];
    lol(i,N)lol(j,N)t[i][j]=0;
    lol(i,h)lol(j,w){
	if(s[i][j]=='.')continue;
	t[i-j+M][i+j]=1;
    }
    ll ans=Solve()+Solve();//cout<<ans<<endl;
    lol(i,N)lol(j,N){if(t[i][j]==0)continue;
	lol(k,N){
	    if(i==k)continue;
	    if(t[k][j]==0)continue;
	    ll d=abs(i-k);
	    if(j-d>=0)if(t[i][j-d]==1)ans--;
	    if(j+d<N)if(t[i][j+d]==1)ans--;
	}
    }
    cout<<ans<<endl;
    return 0;
}