#include<map>
#include<bitset>
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
#include<stack>
#define REP(i,x,y) for(ll i=x;i<=y;i++)
#define SIZE(a) ll(a.size())
#define vll vector<ll> 
#define MEMSET(a, n, m) for(ll i=0;i<=n;i++) a[i] = m
#define BIT(n) (ll(1)<<n)
#define UNIQUE(v) v.erase(unique(v.begin(),v.end()),v.end()) 
#define UNIQUE_ARRAY(a,n) n = unique(a + 1, a + x + 1) - a - 1
#define SORT(a,n) sort(a+1,a+n+1)
#define SORT_O(a,n,order) sort(a+1,a+n+1,order)
#define PER(i,y,x) for(ll i=y;i>=x;i--)
typedef long long ll;
using namespace std;
/*
struct point
{
long long dist; long long name;
bool operator<(const point& rhs) const {
return dist > rhs.dist;
}
};
*/

ll const MAX = 1000;
ll grid[MAX][MAX];
ll h, w;

ll yoko[MAX][MAX];
ll tate[MAX][MAX];

bool ingrid(ll i, ll j) {
	bool flag1 = ((i + j) >= 250);
	bool flag2 = ((i + j) <= 950);
	bool flag3 = (j >= i - 350);
	bool flag4 = (j <= i + 350);
	return flag1 && flag2&&flag3&&flag4;
}

int main() {
	cin >> h >> w;
	REP(i, 0, MAX - 1) {
		REP(j, 0, MAX - 1) {
			grid[i][j] = tate[i][j] = yoko[i][j] = 0;
		}
	}
	REP(i, 1, h) {
		REP(j, 1, w) {
			char c;
			cin >> c;
			if (c == '#') {
				grid[i + j][i - j + 301] = 1;
			}
		}
	}	
	h = 603; w = 603;

	REP(i, 1, h+1) {
		REP(j, 1, w+1) {
			yoko[i][j] = yoko[i][j - 1] + grid[i][j];
		}
	}
	REP(j, 1, w+1) {
		REP(i, 1, h+1) {
			tate[i][j] = tate[i - 1][j] + grid[i][j];
		}
	}
	ll ans = 0;
	REP(i, 1, h) {
		REP(j, 1, w) {
			if (!ingrid(i, j)) continue;
			if (grid[i][j] == 0) continue;
			REP(k, i + 1, h) {
				if (!ingrid(k, j)) break;
				if (grid[k][j] == 0)continue;
				ll r = k - i;
				if (j + r <= w) {
					ll e;
					e = tate[k][j + r] - tate[i - 1][j + r];
					ans += e;

					//cout << e << " "<< i << " "  <<j<< " " << r << endl;
				}
				if (j - r >= 1) {
					ll e;
					e = tate[k][j - r] - tate[i - 1][j - r];
					ans += e;
					//cout << e << " "  << i << " " << j << " " << r << endl;

				}
			}
			REP(l, j + 1, w) {
				if (!ingrid(i, l)) break;
				if (grid[i][l] == 0)continue;
				ll r = l - j;
				if (i + r <= h) {
					ll e;
					e = yoko[i + r][l-1] - yoko[i + r][j];
					ans += e;
					//cout <<e << " " << i << " " << j <<" " << r << endl;

				}
				if (i - r >= 1) {
					ll e;
					e = yoko[i - r][l-1] - yoko[i - r][j];
					ans += e;
					//cout << e << " " << i << " " << j <<  " " << r<< endl;

				}
			}
		}
	}
	cout << ans << endl;
}

