#include <bits/stdc++.h>
using namespace std;
string s[302];
int a[302][302];
int f[302][302];
int n, m;
int calc(int r, int c, int len) {
    if (len < 0) {
        return 0;
    }
    int lsum = 0;
    if (r - 1 > 0 && c - 1 > 0) {
        lsum += f[r - 1][c - 1];
    }
    if (r + len >= n || c + len >= m) {
        len = min(n - r,  m - c);
    }
    int rsum = 0;
    if (r + len >= 1 && c + len >= 1) {
        rsum = f[r + len][c + len];
    }
    return rsum - lsum;
}

void go(int r, int c, long long &ans, int tp) {
    int len = min(n - r, m - c);
    for (int i = 0; i < len; i++) {
        for (int j = i + 1; j <= len; j++) {
            if (a[r + i][c + i] == 0) continue;
            if (a[r + j][c + j] == 0) continue;
            ans += calc(r + j - 2 * (j - i) + tp, c + j + tp, j - i - 2 * tp);
            ans += calc(r + j + tp, c + j - 2 * (j - i) + tp, j - i - 2 * tp);

        }
    }
}

void solve(long long &ans, int tp) {
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            f[i][j] = a[i][j] + f[i - 1][j - 1];
        }
    }
    for (int i = 1; i <= n; i++) {
        go(i, 1, ans, tp);
    }
    for (int i = 2; i <= m; i++) {
        go(1, i, ans, tp);
    }

}
int main() {
    ios_base::sync_with_stdio(0);
    cin >> n >> m;
    for (int i = 1; i <= n; i++) cin >> s[i];
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            if (s[i][j - 1] == '#') a[i][j] = 1;
        }
    }
    long long ans = 0;
    solve(ans, 0);
    for (int i = 1; i <= n; i++) {
        reverse(a[i] + 1, a[i] + m + 1);
    }
    solve(ans, 1);
    cout << ans << "\n";
    return 0;
}