#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:256000000")
#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<algorithm>
#include<cmath>
#include<set>
#include<queue>
#include<sstream>
#include<utility>
#include<map>
#include<ctime>
#include<cstdio>
#include<cassert>
#include<functional>




using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<char, char> pcc;
typedef pair<double, double> pdd;

#define show(x) cerr << x
#define debug(x) show(#x << ": " << (x) << endl)

const long double PI = 3.14159265358979323846;
const long double eps = 1e-5;
const int INF = numeric_limits<int>::max();
const ll LINF = numeric_limits<ll>::max();
const ll mod = 1000 * 1000 * 1000 + 7;


int add(int s, int r, int l, const vector<vector<int> >& d, int m, int n) {
    int id = max(0, s - n + 1);
    r = r - id + 1;
    l = l - id + 1;
    int res = 0;
    if ((r > 0) && (r < d[s].size()))
        res += d[s][r] - d[s][r - 1];
    if ((l > 0) && (l < d[s].size()))
        res += d[s][l] - d[s][l - 1];
    r = min(r, (int)d[s].size());
    l = max(l, 0);
    res += 2 * (d[s][r - 1] - d[s][l]);
    return res;
}

ll solve(const vector<vector<int> >& a, int m, int n) {
    ll res = 0;
    vector<vector<int> > d(m + n - 1, vector<int> (1, 0)); 
    for (int i = 0; i < m; ++i) {
        for (int j = 0; j < n; ++j) {
            d[i + j].push_back(a[i][j]);
        }
    }
    for (int i = 0; i < d.size(); ++i) {
        for (int j = 1; j < d[i].size(); ++j) {
            d[i][j] += d[i][j - 1];
        }
    }
    for (int s = 0; s < d.size(); ++s) {
        int id = max(0, s - n + 1);
        for (int i1 = id; i1 < m; ++i1) {
            int j1 = s - i1;
            if (j1 < 0)
                break;
            if (a[i1][j1] == 0)
                continue;
            for (int i2 = i1 + 1; i2 < m; ++i2) {
                int j2 = s - i2;
                if (j2 < 0)
                    break;
                if (a[i2][j2] == 0)
                    continue;
                int x = i2 - i1;
                int pl = 0, pl1 = 0, pl2 = 0;
                if (s - 2 * x >= 0) {
                    pl1 += add(s - 2 * x, i1, i1 - x, d, m, n);
                }
                if (s + 2 * x < m + n - 1) {
                    pl2 += add(s + 2 * x, i2 + x, i2, d, m, n);
                }
                pl = pl1 + pl2;
                if (pl) {
                    //cerr << i1 << " " << j1 << " " << i2 << " " << j2 << endl;
                    //cerr << pl1 << " " << pl2 << " " << endl;
                    res += pl;
                }
            }
        }
    }
    return res;
}


void solve() {
    int m, n;
    cin >> m >> n;
    vector<string> a(m);
    for (int i = 0; i < m; ++i) {
        cin >> a[i];
    }
    vector<vector<int> > b(m);
    for (int i = 0; i < m; ++i) {
        b[i].resize(n);
        for (int j = 0; j < n; ++j) {
            b[i][j] = (a[i][j] == '#');
        }
    }
    ll res1 = solve(b, m, n);
    for (int i = 0; i < m; ++i) {
        reverse(b[i].begin(), b[i].end());
    }
    ll res2 = solve(b, m, n);
    //cerr << res1 << " " << res2 << endl;
    cout << (res1 + res2) / 2 << endl;


}

//#define LOCAL

int main() {
    ios_base::sync_with_stdio(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif
    solve();


#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif	
    return 0;
}

Measured memory_bytes: 1324