#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = (ll)(1e+9) + 7;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
bool coin[300][300];
ll s1[600][301]; vector<int> v1[600];
ll s2[600][301]; vector<int> v2[600];
int main() {
	int h, w; cin >> h >> w;
	rep(i, h) {
		rep(j, w) {
			char in; cin >> in;
			if (in == '#')coin[i][j] = true;
			else coin[i][j] = false;
		}
	}
	rep(i, h + w-1) {
		rep(j, h) {
			int k = i - j;
			s1[i][j + 1] = s1[i][j];
			if (0 <= k && k < w&&coin[j][k]) {
				s1[i][j + 1]++;
				v1[i].push_back(j);
			}
		}
	}
	rep(i, h + w - 1) {
		rep(j, h) {
			int k = j + w - 1-i;
			s2[i][j + 1] = s2[i][j];
			if (0 <= k && k < w&&coin[j][k]) {
				s2[i][j + 1]++;
				v2[i].push_back(j);
			}
		}
	}
	ll out = 0;
	rep(i, h + w - 1) {
		int len = v1[i].size();
		rep(j, len) {
			Rep(k,j+1, len) {
				int x1 = v1[i][j]; int y1 = i - x1;
				int x2 = v1[i][k]; int y2 = i - x2;
				//cout << x1 << " " << x2 << endl;
				int dis = (x2 - x1)*2;
				int ni = i - dis;
				if (ni >= 0) {
					int sta = max(0, ni - y2);
					int owa = x1;
					out += 2 * (s1[ni][owa + 1] - s1[ni][sta]);
					if (ni - x1 >= 0 && coin[x1][ni - x1])out--;
					if (ni - y2 >= 0 && coin[ni - y2][y2])out--;
				}
				//cout << out << endl;

				ni = i + dis;
				if (ni <= h + w - 1) {
					int sta = x2;
					int owa = min(h - 1, ni - y1);
					out += 2 * (s1[ni][owa + 1] - s1[ni][sta]);
					if (ni - y1 < h && coin[ni - y1][y1])out--;
					if (ni - x2 < w && coin[x2][ni - x2])out--;
				}
		        //cout << out << endl;
			}
		}
	}
	//cout << out << endl;
	rep(i, h + w - 1) {
		int len = v2[i].size();
		rep(j, len) {
			Rep(k, j + 1, len) {
				int x1 = v2[i][j]; int y1 = x1 + w - 1 - i;
				int x2 = v2[i][k]; int y2 = x2 + w - 1 - i;
				//cout << x1 << " " << x2 << endl;
				int dis = (x2 - x1) * 2;
				int ni = i - dis;
				if (ni >= 0) {
					int sta = max(0, x2-dis);
					int owa = x1;
					out += 2 * (s2[ni][owa + 1] - s2[ni][sta]);
					if (x2 - dis >= 0 && coin[x2-dis][y2])out--;
					if (y1 +dis < w && coin[x1][y1+dis])out--;
				}
				//cout << out << endl;

				ni = i + dis;
				if (ni <= h + w - 1) {
					int sta = x2;
					int owa = min(h - 1, x1+dis);
					out += 2 * (s2[ni][owa + 1] - s2[ni][sta]);
					if (y2 - dis >= 0 && coin[x2][y2-dis])out--;
					if (x1 +dis < h && coin[x1+dis][y1])out--;
				}
				//cout << out << endl;
			}
		}
	}
	cout << out / 2 << endl;
	return 0;
}

Measured memory_bytes: 4224