#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long ll;
const ll M = 998244353;

int main(){
	static ll H,W;
	static char s[302][302];
	scanf("%lld%lld",&H,&W);
	for(int i = 1 ; i <= H ; i ++){
		scanf("\n");
		for(int j = 1 ; j <= W ; j ++){
			scanf("%c",&s[i][j]);
		}
	}
	
	static ll a[605][605] = {};
	static ll b[605][605] = {};
	static ll c[605][605] = {};
	for(int i = 1 ; i <= H ; i ++){
		for(int j = 1 ; j <= W ; j ++){
			if(s[i][j] == '#')a[i+j][i-j+302] = 1;
			b[i+j][i-j+302] = a[i+j][i-j+302];
			c[i+j][i-j+302] = a[i+j][i-j+302];
		}
	}
	for(int i = 2 ; i <= 600 ; i ++){
		for(int j = 1 ; j <= 602 ; j ++){
			b[i][j] += b[i][j-1];
		}
	}
	
	//cout << a[2][302] << endl;
	//cout << b[2][302] << endl;
	//cout << b[2][299] << endl;
	
	ll ret = 0;
	for(int i = 2 ; i <= 600 ; i ++){
		for(int j = 2 ; j <= 602 ; j += 2){
			if((i+j)&1)j ++;
			if(a[i][j] == 0)continue;
			for(int k = j+2 ; k <= 602 ; k += 2){
				if(a[i][k] == 0)continue;
				if(i-k+j >= 0)ret += b[i-(k-j)][k]-b[i-(k-j)][j-1];
				if(i+k-j < 605)ret += b[i+(k-j)][k]-b[i+(k-j)][j-1];
			}
		}
	}
	//cout << ret << endl;
	
	for(int j = 2 ; j <= 602 ; j ++){
		for(int i = 2 ; i <= 600 ; i ++){
			c[i][j] += c[i-1][j];
		}
	}
	for(int j = 2 ; j <= 602 ; j ++){
		for(int i = 2 ; i <= 600 ; i += 2){
			if((i+j)&1)i ++;
			if(a[i][j] == 0)continue;
			for(int k = i+2 ; k <= 600 ; k += 2){
				if(a[k][j] == 0)continue;
				if(j-k+i >= 0)ret += c[k-1][j-(k-i)]-c[i+1][j-(k-i)];
				if(j+k-i < 605)ret += c[k-1][j+(k-i)]-c[i+1][j+(k-i)];
			}
		}
	}
	cout << ret << endl;
}
	