#include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) (((x) < 0)?-(x):(x))
#define uint unsigned int
#define dbl long double
#define pi 3.14159265358979323846
using namespace std;
// mylittledoge

using cat = long long;

#ifdef DONLINE_JUDGE
	// palindromic tree is better than splay tree!
	#define lld I64d
#endif

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	int H, W;
	cin >> H >> W;
	vector<string> S(H);
	for(int i = 0; i < H; i++) cin >> S[i];
	vector< vector< vector<int> > > cnt(H, vector< vector<int> >(W, vector<int>(H+W, 0)));
	cat ans = 0;
	for(int k = 0; k < 2; k++) {
		for(int l = 0; l < 2; l++) {
			for(int i = 1; i < H; i++) for(int j = 1; j < W; j++) for(int d = 2; d <= i+j; d++) {
				cnt[i][j][d] = cnt[i][j-1][d-1];
				if(i-d+1 >= 0) cnt[i][j][d] += (S[i-d+1][j-1] == '#');
			}
			for(int i = 0; i < H; i++) for(int j = 0; j < W; j++) if(S[i][j] == '#')
				for(int d = 1; d <= min(i, W-1-j); d++) if(S[i-d][j+d] == '#') ans += cnt[i-d][j][d];
			reverse(begin(S), end(S));
		}
		for(int i = 0; i < H; i++) reverse(begin(S[i]), end(S[i]));
	}
	for(int i = 0; i < H; i++) for(int j = 0; j < W; j++) if(S[i][j] == '#') {
		for(int k = 1; k <= j/2; k++) if(S[i][j-2*k] == '#') {
			if(k <= i && S[i-k][j-k] == '#') ans++;
			if(i+k < H && S[i+k][j-k] == '#') ans++;
		}
		for(int k = 1; k <= i/2; k++) if(S[i-2*k][j] == '#') {
			if(k <= j && S[i-k][j-k] == '#') ans++;
			if(j+k < W && S[i-k][j+k] == '#') ans++;
		}
	}
	cout << ans << "\n";
	return 0;
}

// look at my code
// my code is amazing
