#include <bits/stdc++.h>

using namespace std;

#ifdef DEBUG_MODE
	#define DBG(n) n;
#else
	#define DBG(n) ;
#endif
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007

typedef long long ll;
typedef pair<ll,ll> P;

int mp[666][666];
int sum[666][666];
int sum1[666][666];

int main(){

	int h,w;cin >> h >> w;
	REP(i,h){
		REP(j,w){
			char tmp;cin >> tmp;
			if(tmp == '#'){
				mp[i+j][h-i+j] = 1;
				sum[i+j][h-i+j] = 1;
				sum1[i+j][h-i+j] = 1;
			}
		}
	}

	REP(i,666){
		REP(j,666){
			if(j < 665)sum[i][j+1] += sum[i][j];
			if(i < 665)sum1[i+1][j] += sum1[i][j];
		}
	}
	ll ans = 0;

	REP(i,666){
		vector<int> v;
		REP(j,666){
			if(mp[i][j]){
				REP(k,v.size()){
					int tmp = j - v[k];
					if(i - tmp >= 0){
						ans += sum[i-tmp][j] - sum[i-tmp][j-tmp-1];
					}
					if(i + tmp < 666){
						ans += sum[i+tmp][j] - sum[i+tmp][j-tmp-1];
					}
				}
				v.PB(j);
			}
		}
	}

	REP(j,666){
		vector<int> v;
		REP(i,666){
			if(mp[i][j]){
				REP(k,v.size()){
					int tmp = i - v[k];
					if(j - tmp >= 0){
						ans += sum1[i-1][j-tmp] - sum1[i-tmp][j-tmp];
					}
					if(j + tmp < 666){
						ans += sum1[i-1][j+tmp] - sum1[i-tmp][j+tmp];
					}
				}
				v.PB(i);
			}
		}
	}

	cout << ans << endl;

	return 0;
}
