#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<stack>
#include<cstring>
#include<utility>

#define int long long
using namespace std;
#define rep(i, n) for(int i=0;i<(n);++i)
typedef pair<int, int> pii;
const int INF = 1l << 60;
#define u_b upper_bound
#define l_b lower_bound

bool coinuv[600][600];
int rua[601][601];
int rub[601][601];

signed main() {
    int H, W;
    cin >> H >> W;
    rep(i, H) {
        rep(j, W) {
            char c;
            cin >> c;
            if (c == '#')coinuv[i - j + 300][i + j] = true;
        }
    }
    int ans = 0;
    rep(i, 600) {
        rep(j, 600) {
            if (coinuv[i][j]) {
                for (int k = 1; i - k >= 0; ++k) {
                    if (coinuv[i - k][j]) {
                        if (j + k < 600 && coinuv[i][j + k])ans++;
                        if (j - k >= 0 && coinuv[i][j - k])ans++;
                    }
                }
                for (int k = 1; i + k < 600; ++k) {
                    if (coinuv[i + k][j]) {
                        if (j + k < 600 && coinuv[i][j + k])ans++;
                        if (j - k >= 0 && coinuv[i][j - k])ans++;
                    }
                }
            }
        }
    }

    rep(i, 600) {
        rep(j, 600) {
            rua[i + 1][j] = rua[i][j] + coinuv[i][j];
            rub[i][j + 1] = rub[i][j] + coinuv[i][j];
        }
    }

    rep(i, 600) {
        rep(j, 600) {
            if (coinuv[i][j]) {
                for (int k = 1; i + k < 600; ++k) {
                    if (coinuv[i + k][j]) {
                        //i+1~i+k-1[j+-k]
                        if (j + k < 600)ans += rua[i + k][j + k] - rua[i + 1][j + k];
                        if (j - k >= 0)ans += rua[i + k][j - k] - rua[i + 1][j - k];
                    }
                }
                for (int k = 1; j + k < 600; ++k) {
                    if (coinuv[i][j + k]) {
                        //[i+-k]j+1~j+k-1
                        if (i + k < 600)ans += rub[i + k][j + k] - rub[i + k][j + 1];
                        if (i - k >= 0)ans += rub[i - k][j + k] - rub[i - k][j + 1];
                    }
                }
            }
        }
    }

    cout << ans << endl;
    return 0;
}
