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

template <typename Tp> inline void getint(Tp &num){
	register int ch, neg = 0;
	while(!isdigit(ch = getchar())) if(ch == '-') neg = 1;
	num = ch & 15;
	while(isdigit(ch = getchar())) num = num * 10 + (ch & 15);
	if(neg) num = -num;
}

int H, W, N, sum[605][605], ans; char str[305];
vector<int> r[605], c[605];

inline int calcr(int x, const int &l, const int &r){
	if(l > r || x < 1 || x > N) return 0;
	return sum[x][r] - sum[x - 1][r] - sum[x][l - 1] + sum[x - 1][l - 1];
}

inline int calcc(const int &d, const int &u, int y){
	if(d > u || y < 1 || y > N) return 0;
	return sum[u][y] - sum[u][y - 1] - sum[d - 1][y] + sum[d - 1][y - 1];
}

int main(){
	getint(H), getint(W), N = H + W;
	for(register int i = 1; i <= H; i++){
		scanf("%s", str + 1);
		for(register int j = 1; j <= W; j++) if(str[j] == '#'){
			sum[i + j][i - j + W]++;
			r[i + j].push_back(i - j + W);
			c[i - j + W].push_back(i + j);
		}
	}
	for(register int i = 1; i <= N; i++)
		for(register int j = 1; j <= N; j++)
			sum[i][j] += sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1];
	for(register int i = 1; i <= N; i++){
		sort(r[i].begin(), r[i].end());
		for(register int j = 0, siz = r[i].size(); j < siz; j++)
			for(register int k = j + 1; k < siz; k++){
				const int d = r[i][k] - r[i][j];
				ans += calcr(i - d, r[i][j], r[i][k]);
				ans += calcr(i + d, r[i][j], r[i][k]);
			}
		sort(c[i].begin(), c[i].end());
		for(register int j = 0, siz = c[i].size(); j < siz; j++)
			for(register int k = j + 1; k < siz; k++){
				const int d = c[i][k] - c[i][j];
				ans += calcc(c[i][j] + 1, c[i][k] - 1, i - d);
				ans += calcc(c[i][j] + 1, c[i][k] - 1, i + d);
			}
	}
	return printf("%d\n", ans), 0;
}