#include<bits/stdc++.h>
using namespace std;
namespace whatever{
	int readu(){
		char ch=getchar();
		while(!isdigit(ch))
			ch=getchar();
		int value=ch-'0';
		ch=getchar();
		while(isdigit(ch)){
			value=value*10+ch-'0';
			ch=getchar();
		}
		return value;
	}
	void writeull(long long n){
		if(n<10)
			putchar(n+'0');
		else{
			writeull(n/10);
			putchar(n%10+'0');
		}
	}
	void run(){
		cerr<<"time(0): "<<time(0)<<endl;
		int h=readu();
		int w=readu();
		static char s[300][301];
		for(int i=0; i<h; ++i){
			gets(s[i]);
			assert(int(strlen(s[i]))==w);
		}
		static int cnt[300][300];
		long long result=0;
		int first_a;
		int last_a;
		memset(cnt, 0, sizeof(cnt));
		for(int i=0; i<h; ++i)
			for(int j=0; j<w; ++j){
				cnt[i][j]=int(s[i][j]=='#');
				if(i!=0&&j!=0)
					cnt[i][j]+=cnt[i-1][j-1];
			}
		for(int i=0; i<h; ++i)
			for(int j=0; j<w; ++j)
				if(s[i][j]=='#')
					for(int k=1; k<min(h-i, w-j); ++k)
						if(s[i+k][j+k]=='#'){
							first_a=max(0, k-i);
							last_a=min(k, w-(j+k)-1);
							if(first_a<=last_a){
								result+=cnt[i-k+last_a][j+k+last_a];
								if(i-k+first_a-1>=0&&j+k+first_a-1>=0)
									result-=cnt[i-k+first_a-1][j+k+first_a-1];
							}
							first_a=max(0, k-j);
							last_a=min(k, h-(i+k)-1);
							if(first_a<=last_a){
								result+=cnt[i+k+last_a][j-k+last_a];
								if(i+k+first_a-1>=0&&j-k+first_a-1>=0)
									result-=cnt[i+k+first_a-1][j-k+first_a-1];
							}
						}
		cerr<<"result: "<<result<<endl;
		for(int i=0; i<h; ++i)
			reverse(s[i], s[i]+w);
		memset(cnt, 0, sizeof(cnt));
		for(int i=0; i<h; ++i)
			for(int j=0; j<w; ++j){
				cnt[i][j]=int(s[i][j]=='#');
				if(i!=0&&j!=0)
					cnt[i][j]+=cnt[i-1][j-1];
			}
		for(int i=0; i<h; ++i)
			for(int j=0; j<w; ++j)
				if(s[i][j]=='#')
					for(int k=2; k<min(h-i, w-j); ++k)
						if(s[i+k][j+k]=='#'){
							first_a=max(1, k-i);
							last_a=min(k-1, w-(j+k)-1);
							if(first_a<=last_a){
								result+=cnt[i-k+last_a][j+k+last_a];
								if(i-k+first_a-1>=0&&j+k+first_a-1>=0)
									result-=cnt[i-k+first_a-1][j+k+first_a-1];
							}
							first_a=max(1, k-j);
							last_a=min(k-1, h-(i+k)-1);
							if(first_a<=last_a){
								result+=cnt[i+k+last_a][j-k+last_a];
								if(i+k+first_a-1>=0&&j-k+first_a-1>=0)
									result-=cnt[i+k+first_a-1][j-k+first_a-1];
							}
						}
		writeull(result);
		putchar('\n');
	}
}
int main(){
	whatever::run();
}