#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <map>
#include <utility>
#define LL long long
using namespace std;
const int Maxn = 310;
int mp[Maxn][Maxn], tot;
int n, m;
char s[Maxn][Maxn];
int f[2][Maxn<<1][Maxn], g[2][Maxn<<1][Maxn];
int ffind(int x, int y) {
	if(x < 0 || x >= n || y < 0 || y >= m) return 0;
	return mp[x][y] > 0 ? 1 : 0;
}
int calcf(int op, int x, int y) {
	if(y < 0 || x < 0 || x > n-1+m-1) return 0;
	if(y >= n) return f[op][x][n-1];
	return f[op][x][y];
}
int calcg(int op, int x, int y) {
	if(y < 0 || x < 0 || x > n-1+m-1) return 0;
	if(y >= n) return g[op][x][n-1];
	return g[op][x][y];
}
int main() {
	int i, j, k;
	scanf("%d%d", &n, &m);
	for(i = 0; i < n; i++) scanf("%s", s[i]);
	for(i = 0; i < n; i++){
		for(j = 0; j < m; j++){
			if(s[i][j] == '#') mp[i][j] = ++tot;
		}
	}
	for(i = 0; i < n; i++){
		for(j = 0; j < m; j++){
			if(mp[i][j] == 0) continue;
			f[0][i+m-1-j][i] = 1;
			f[1][i+j][i] = 1;
		}
	}
	for(i = 0; i <= n-1+m-1; i++){
		for(j = 1; j < n; j++){
			f[0][i][j] += f[0][i][j-1];
			f[1][i][j] += f[1][i][j-1];
		}
	}
	LL ans = 0;
	for(k = 2; k <= n+m; k += 2){
		memset(g, 0, sizeof(g));
		for(i = 0; i < n; i++){
			for(j = 0; j < m; j++){
				if(mp[i][j] == 0) continue;
				g[0][i+m-1-j][i] = ffind(i-k/2, j-k/2);
				g[1][i+j][i] = ffind(i-k/2, j+k/2);
			}
		}
		for(i = 0; i <= n-1+m-1; i++){
			for(j = 1; j < n; j++){
				g[0][i][j] += g[0][i][j-1];
				g[1][i][j] += g[1][i][j-1];
			}
		}
		for(i = 0; i < n; i++){
			for(j = 0; j < m; j++){
				if(mp[i][j] == 0) continue;
				int x = i, y = j;
				if(ffind(x+k/2, y+k/2) > 0){
					ans += calcf(0, i+m-1-j+k, i+k-1) - calcf(0, i+m-1-j+k, i+k/2-1);
					ans += calcf(0, i+m-1-j-k, i-1) - calcf(0, i+m-1-j-k, i-k/2-1);
				}
				if(ffind(x-k/2, y-k/2) > 0){
					ans += calcf(0, i+m-1-j+k, i+k/2) - calcf(0, i+m-1-j+k, i);
					ans += calcf(0, i+m-1-j-k, i-k/2) - calcf(0, i+m-1-j-k, i-k);
				}
				if(ffind(x+k/2, y-k/2) > 0){
					ans += calcf(1, i+j+k, i+k-1) - calcf(1, i+j+k, i+k/2);
					ans += calcf(1, i+j-k, i-1) - calcf(1, i+j-k, i-k/2);
				}
				if(ffind(x-k/2, y+k/2) > 0){
					ans += calcf(1, i+j+k, i+k/2-1) - calcf(1, i+j+k, i);
					ans += calcf(1, i+j-k, i-k/2-1) - calcf(1, i+j-k, i-k);
				}
				ans += calcg(0, i+m-1-j+k, i+k) - calcg(0, i+m-1-j+k, i+k/2-1);
				ans += calcg(0, i+m-1-j-k, i) - calcg(0, i+m-1-j-k, i-k/2-1);
				ans += calcg(1, i+j+k, i+k) - calcg(1, i+j+k, i+k/2-1);
				ans += calcg(1, i+j-k, i) - calcg(1, i+j-k, i-k/2-1);
			}
		}
	}
	printf("%lld\n", ans/3);
	return 0;
}