#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)

int main() {
    const int M = 300;
    int h, w; cin >> h >> w;
    vector<string> s(h); for (auto &si: s) cin >> si;
    vector<vector<bool>> b(M * 2, vector<bool>(M * 2));
    for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) {
        if (s[i][j] == '#') b[i + j][i - j + M] = true;
    }
    auto calc = [&](bool rev) {
        if (rev) rep(i, M * 2) rep(j, i) swap(b[i][j], b[j][i]);
        vector<vector<int>> acc(M * 2, vector<int>(M * 2 + 1));
        rep(i, M * 2) rep(j, M * 2) acc[i][j + 1] = acc[i][j] + b[i][j];
        long long ans = 0;
        rep(i, M * 2) rep(j, M * 2) if (b[i][j]) {
            for (int k = j + 1; k < M * 2; k++) if (b[i][k]) {
                int d = k - j, lf = rev ? j + 1 : j, rg = rev ? k : k + 1;
                if (0 <= i - d)    ans += acc[i - d][rg] - acc[i - d][lf];
                if (i + d < M * 2) ans += acc[i + d][rg] - acc[i + d][lf];
            }
        }
        return ans;
    };
    cout << calc(false) + calc(true) << endl;
    return 0;
}
