#include <bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef pair<int , int> P2;
typedef pair<pair<int , int> , int> P3;
typedef pair<pair<int , int> , pair<int , int> > P4;
#define PB(a) push_back(a)
#define MP(a , b) make_pair((a) , (b))
#define M3P(a , b , c) make_pair(make_pair((a) , (b)) , (c))
#define M4P(a , b , c , d) make_pair(make_pair((a) , (b)) , make_pair((c) , (d)))
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)

const int MC = 333;
int H,W;
int c[MC*2][MC*2];
int sh[MC*2][MC*2],sw[MC*2][MC*2];

int main(){
	cin >> H >> W;
	repp(i,0,H){
		string s; cin >> s;
		repp(j,0,W) c[i+1+j+1][i-j+MC] = sh[i+j+2][i-j+MC] = sw[i+j+2][i-j+MC] = (s[j]=='#'?1:0);
	}
	int z = W+H;
	W = H+MC;
	H = z;
	repp(i,0,H+1) repp(j,0,W+1){
		sh[i+1][j] += sh[i][j];
		sw[i][j+1] += sw[i][j];
	}
	LL ans = 0;
	repp(i,1,H+1) repp(j,1,W+1) repp(k,j+1,W+1){
		if(!c[i][j] || !c[i][k]) continue;
		int d = k-j;
		if(d < i) ans += sw[i-d][k] - sw[i-d][j-1];
		if(i+d <= H) ans += sw[i+d][k] - sw[i+d][j-1];
	}
	repp(j,1,W+1) repp(i,1,H+1) repp(k,i+1,H+1){
		if(!c[i][j] || !c[k][j]) continue;
		int d = k-i;
		if(d < j) ans += sh[k-1][j-d] - sh[i][j-d];
		if(j+d <= W) ans += sh[k-1][j+d] - sh[i][j+d];
	}
	cout << ans << endl;
	return 0;
}
