#include <cstdio>

char s[304];
int _a[608][608], (*const a)[608] = _a + 304;
int _b[608][608], (*const b)[608] = _b + 304;

int main() {
	int n, m;
	scanf("%d%d",&n,&m);
	for (int i = 0; i < n; i++) {
		scanf("%s",s);
		for (int j = 0; j < m; j++)
			a[i-j][i+j] = s[j] == '#';
	}
	for (int i = 1-m; i < n; i++) {
		b[i][0] = 0;
		for (int j = 0; j < n+m-1; j++)
			b[i][j+1] = b[i][j] + a[i][j];
	}
	long long ans = 0;
	for (int i = 1-m; i < n; i++)
		for (int j = 1; j < n+m-1; j++) if (a[i][j])
			for (int k = 0; k < j; k++) if (a[i][k]) {
				int d = j-k;
				if (i+d < n) ans += b[i+d][j+1] - b[i+d][k];
				if (i-d > -m) ans += b[i-d][j+1] - b[i-d][k];
			}
	for (int j = 0; j < n+m-1; j++) {
		b[0][j] = 0;
		for (int i = 1-m; i < n; i++)
			b[i+1][j] = b[i][j] + a[i][j];
	}
	for (int i = 0; i < n+m-1; i++)
		for (int j = 2-m; j < n; j++) if (a[j][i])
			for (int k = 1-m; k < j; k++) if (a[k][i]) {
				int d = j-k;
				if (i+d < n+m-1) ans += b[j][i+d] - b[k+1][i+d];
				if (i-d >= 0) ans += b[j][i-d] - b[k+1][i-d];
			}
	printf("%lld\n",ans);
	return 0;
}
