#include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;
int N,M,F[2][305][305];
char A[305][305];
long long Ans;
inline int LU(int x,int y,int k){
	if (k<1) return 0;
	k+=min(0,min(x-k,y-k));
	return F[0][x][y]-F[0][x-k][y-k];
}
inline int RU(int x,int y,int k){
	if (k<1) return 0;
	k+=min(0,min(x-k,M-y-k+1));
	return F[1][x][y]-F[1][x-k][y+k];
}
inline int Calc(int x_1,int y_1,int x_2,int y_2){
	if (x_2<x_1) swap(x_1,x_2),swap(y_1,y_2);
	if (y_1<=y_2){
		int z=max(x_2-N,y_2-M);
		if (z>0) x_2-=z,y_2-=z;
		if (x_2<1||y_2<1) return 0;
		return LU(x_2,y_2,x_2-x_1+1);
	}
	if (y_1>=y_2){
		int z=max(x_2-N,1-y_2);
		if (z>0) x_2-=z,y_2+=z;
		if (x_2<1||y_2>M) return 0;
		return RU(x_2,y_2,x_2-x_1+1);
	}
}
int main(){
	scanf("%d%d",&N,&M);
	for (int i=1;i<=N;++i) scanf("%s",A[i]+1);
	for (int i=1;i<=N;++i)
		for (int j=1;j<=M;++j) F[0][i][j]=F[0][i-1][j-1]+(A[i][j]=='#'),F[1][i][j]=F[1][i-1][j+1]+(A[i][j]=='#');
	int KS=min(N,M);
	for (int i=1;i<=N;++i)
		for (int j=1;j<=M;++j)
			for (int k=KS;k;--k){
				if (i>k&&j>k&&A[i-k][j]=='#'&&A[i][j-k]=='#') Ans+=Calc(i-k,j-2*k,i-2*k+1,j-k-1);
				if (i+k<=N&&j+k<=M&&A[i+k][j]=='#'&&A[i][j+k]=='#') Ans+=Calc(i+k,j+2*k,i+2*k-1,j+k+1);
				if (i>k&&j+k<=M&&A[i-k][j]=='#'&&A[i][j+k]=='#') Ans+=Calc(i-2*k,j+k,i-k-1,j+2*k-1);
				if (i+k<=N&&j>k&&A[i+k][j]=='#'&&A[i][j-k]=='#') Ans+=Calc(i+2*k,j-k,i+k+1,j-2*k+1);
			}
	printf("%d\n",Ans);
	return 0;
}