#include <bits/stdc++.h>
#define LL long long
#define ri register int
#define pii pair<int, int>
#define pll pair<LL, LL>
using namespace std;
inline int read()
{
	int ret = 0; char ch = getchar();
	while(ch < '0' || ch > '9')
		ch = getchar();
	do {
		ret = ret * 10 + ch - '0';
		ch = getchar();
	} while('0' <= ch && ch <= '9');
	return ret;
}
inline void write(int x) // x > 0 (x != 0) ***
{
	if(!x)
		return ;
	write(x / 10);
	putchar(x % 10 + '0');
}
#define maxn 1010
#define hshs 310
int n, m;
int a[maxn][maxn];
int s1[maxn][maxn], s2[maxn][maxn];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> n >> m;
	string s;
	for(int i = 1; i <= n; i ++)
	{
		cin >> s;
		for(int j = 1; j <= m; j ++)
		{
			a[hshs + i][hshs + j] = s[j - 1] == '#';
		}
	}
	for(int i = 1; i <= n + 2 * hshs; i ++)
	{
		for(int j = 1; j <= m + 2 * hshs; j ++)
			s1[i][j] = s1[i - 1][j - 1] + a[i][j];
		for(int j = m + 2 * hshs; j; j --)
			s2[i][j] = s2[i - 1][j + 1] + a[i][j];
	}
	int Ans = 0;
	for(int i = 1; i <= n; i ++)
		for(int j = 1; j <= m; j ++)
			for(int k = 1; k <= min(n, m); k ++)
			{
//				cout << i << ' ' << j << ' ' << k << ' ' << Ans << endl;
				if(i - k > 0 && j - k > 0 && a[hshs + i][hshs + j - k] && a[hshs + i - k][hshs + j])
					Ans += s2[hshs + i + k - 1][hshs + j + 1] - s2[hshs + i - 1][hshs + j + k + 1];
				if(i - k > 0 && j + k <= m && a[hshs + i][hshs + j + k] && a[hshs + i - k][hshs + j])
					Ans += s1[hshs + i + k][hshs + j] - s1[hshs + i][hshs + j - k];
				if(i + k <= n && j + k <= m && a[hshs + i][hshs + j + k] && a[hshs + i + k][hshs + j])
					Ans += s2[hshs + i][hshs + j - k] - s2[hshs + i - k][hshs + j];
				if(i + k <= n && j - k > 0 && a[hshs + i][hshs + j - k] && a[hshs + i + k][hshs + j])
					Ans += s1[hshs + i - 1][hshs + j + k - 1] - s1[hshs + i - k - 1][hshs + j - 1];
			}
	cout << Ans << endl;
	return 0;
}
