#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;
#define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i))
#define rep(i,j) FOR(i,0,j)
#define each(x,y) for(auto &(x):(y))
#define mp make_pair
#define MT make_tuple
#define all(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<(x)<<endl
#define smax(x,y) (x)=max((x),(y))
#define smin(x,y) (x)=min((x),(y))
#define MEM(x,y) memset((x),(y),sizeof (x))
#define sz(x) (int)(x).size()
#define RT return
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vll = vector<ll>;

const int DY[] = { -1,0,1,0 };
const int DX[] = { 0,1,0,-1 };

int H, W;
string S[301];

bool f(int y, int x) {
    return y >= 0 && x >= 0 && y < H&&x < W&&S[y][x] == '#';
}

ll g() {
    int N = H + W;
    vector<vll> sum(N, vll(N));
    rep(i, N) {
        // x+y=i
        // i-y>=0 y<=i
        rep(y, N - 1) {
            int x = i - y;
            sum[i][y + 1] = sum[i][y] + f(y, x);
        }
    }

    ll res = 0;
    rep(y, H)rep(x, W) {
        if (!f(y, x))continue;
        FOR(i, 1, min(H, W)) {
            int yy = y - i;
            int xx = x + i;
            if (!f(yy, xx))continue;
            for (int j : {i, -i}) {
                if (f(y + j, x + j))res++;
                if (f(yy + j, xx + j))res++;
                int k = x + y + j * 2;
                int lb = max(yy + j + 1, 0);
                int ub = y + j;
                if (k >= 0 && k < N && lb < ub) {
                    res += (sum[k][ub] - sum[k][lb]) * 2;
                }
            }
        }
    }
    return res;
}

void solve() {
    cin >> H >> W;
    rep(y, H)cin >> S[y];
    ll ans = g();
    reverse(S, S + H);
    ans += g();
    ans /= 2;
    cout << ans << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}