#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
#define MOD @
#define ADD(X,Y) ((X) = ((X) + (Y)%MOD) % MOD)
typedef long long i64; typedef vector<int> ivec; typedef vector<string> svec;

int H, W, N;
char S[330][330];
int A[620][620];
int acc[620][620];

i64 ret;

void solve()
{
	for (int i = 0; i < N; ++i) {
		acc[i][0] = 0;
		for (int j = 0; j < N; ++j) {
			acc[i][j + 1] = acc[i][j] + A[i][j];
		}
	}

	for (int y = 0; y < N; ++y) {
		for (int x = 0; x < N; ++x) {
			if (A[y][x] == 0) continue;
			for (int x2 = x + 1; x2 < N; ++x2) {
				if (A[y][x2] == 0) continue;

				int d = x2 - x;
				if (y + d < N) {
					ret += acc[y + d][x2] - acc[y + d][x + 1];
					ret += A[y + d][x];
				}
			}
		}
	}
}
int A2[620][620];
void rot()
{
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			A2[i][j] = A[j][N - 1 - i];
		}
	}
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			A[i][j] = A2[i][j];//[j][N - 1 - i];
		}
	}
}
int main()
{
	scanf("%d%d", &H, &W);
	for (int i = 0; i < H; ++i) scanf("%s", S[i]);

	N = H + W;
	for (int i = 0; i < H; ++i) {
		for (int j = 0; j < W; ++j) {
			if (S[i][j] == '#') {
				int x = i + j;
				int y = i - j + W - 1;
				A[x][y] = 1;
			}
		}
	}

	ret = 0;
	solve(); rot();
	solve(); rot();
	solve(); rot();
	solve(); rot();

	printf("%lld\n", ret);

	return 0;
}
