#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>

#define FASTIO
#define ALL(v) (v).begin(), (v).end()
#define rep(i, l, r) for (int i = (l); i < (r); ++i)

#ifdef FASTIO
#define scanf abacaba
#define printf abacaba
#endif

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;


/*
ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}
*/

const int MX = 610;

int n, m;
int a[MX][MX];
string tmps[310];
int sm[MX][MX];

int get(int x1, int y1, int x2, int y2) {
	x1 = max(x1, 0);
	y1 = max(y1, 0);
	x2 = min(x2, n);
	y2 = min(y2, n);
	if (x1 >= x2 || y1 >= y2)
		return 0;
	return sm[x2][y2] - sm[x2][y1] - sm[x1][y2] + sm[x1][y1];
}

int main() {
#ifdef FASTIO
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#endif
	cin >> n >> m;
	for (int i = 0; i < n; ++i)
		cin >> tmps[i];
	for (int i = 0; i < n; ++i)
		for (int j = 0; j < m; ++j) {
			if (tmps[i][j] == '#')
				a[i - j + m][i + j] = 1;
		}
	n = m = n + m;
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= n; ++j) {
			sm[i][j] = sm[i - 1][j] + sm[i][j - 1] - sm[i - 1][j - 1] + a[i - 1][j - 1];
		}
	ll ans = 0;
	for (int i = 0; i < n; ++i)
		for (int j = 0; j < n; ++j) {
			if (!a[i][j])
				continue;
			for (int k = j + 2; k < n; k += 2) {
				if (a[i][k]) {
					ans += get(i + (k - j), j, i + (k - j) + 1, k + 1);
					ans += get(i - (k - j), j, i - (k - j) + 1, k + 1);
				}
			}
			for (int k = i + 2; k < n; k += 2) {
				if (a[k][j]) {
					ans += get(i + 1, j + (k - i), k, j + (k - i) + 1);
					ans += get(i + 1, j - (k - i), k, j - (k - i) + 1);
				}
			}
		}
	cout << ans << "\n";
	return 0;
}


