#include<bits/stdc++.h>
const int N=305;
long long ans;
int H,W,a[N][N],b[N*2][N*2],c[N*2][N*2],i,j,d;
char cc[N];
int main(){
	scanf("%d%d",&H,&W);
	for(i=1;i<=H;++i)for(scanf("%s",cc+1),j=1;j<=W;++j)if(cc[j]=='#')
		a[i][j]=b[i-j+W][i+j-1]=c[i+j-1][i-j+W]=1;
	for(i=1;i<N*2;++i)for(j=1;j<N*2;++j)b[i][j]+=b[i][j-1],c[i][j]+=c[i][j-1];
	for(d=1;d<=std::min(H,W);d++){
		for(i=1;i<=H-d;++i)for(j=1;j<=W-d;++j)if(a[i][j]==1 && a[i+d][j+d]==1){
			int x=i-j+W,y=i+j-1;
			if(x>d*2)ans+=b[x-d*2][y+d*2]-b[x-d*2][y-1];
			if(x+d*2<N*2)ans+=b[x+d*2][y+d*2]-b[x+d*2][y-1];
		}
		for(i=1;i<=H-d;++i)for(j=d+1;j<=W;++j)if(a[i][j]==1 && a[i+d][j-d]==1){
			int x=i-j+W,y=i+j-1;
			if(y>d*2)ans+=c[y-d*2][x+d*2]-c[y-d*2][x-1];
			if(y+d*2<N*2)ans+=c[y+d*2][x+d*2]-c[y+d*2][x-1];
		}
		for(i=1;i<=H;++i)for(j=1;j<=W;++j)if(a[i][j]){
			int p=i>d && j>d?a[i-d][j-d]:0,q=i>d && j+d<=W?a[i-d][j+d]:0,
				r=i+d<=H && j+d<=W?a[i+d][j+d]:0,s=i+d<=H && j>d?a[i+d][j-d]:0;
			ans-=p*q+q*r+r*s+s*p;
		}
	}
	printf("%lld\n",ans);
	return 0;
}