#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
int h, w, b[605][605], c[605][605], d[605][605];
long long ans;
char s[305];
int main(){
	scanf("%d %d", &h, &w);
	rep(i,h){
		scanf("\n%s", s);
		rep(j,w) if(s[j] == '#') b[i+j][i-j+w] = 1;
	}
	rep(i,h+w) rep(j,h+w){
		c[i][j+1] = c[i][j] + b[i][j];
		d[i+1][j] = d[i][j] + b[i][j];
	}
	rep(i,h+w) rep(j,h+w) if(b[i][j]) rep(k,h+w){
		if(j+k < h+w && b[i][j+k]) ans += (i >= k ? c[i-k][j+k] - c[i-k][j] : 0) + (i+k < h+w ? c[i+k][j+k] - c[i+k][j] : 0);
		if(i+k < h+w && b[i+k][j]) ans += (j >= k ? d[i+k+1][j-k] - d[i][j-k] : 0) + (j+k < h+w ? d[i+k][j+k] - d[i+1][j+k] : 0);
	}
	printf("%lld\n", ans);
}