#include <bits/stdc++.h>

using namespace std;

using i64 = int64_t;

const i64 MOD = 1e9+7;

const i64 INF = 1e18+7;

signed main(){
    int h, w;
    cin >> h >> w;
    array<bitset<601>, 601> v;
    vector<pair<int,int>> p;
    for(int i = 0; i < h; ++i){
        string s;
        cin >> s;
        for(int j = 0; j < w; ++j)
            if(s[j] == '#'){
                v[i + j].set(i - j + 300);
                p.emplace_back(i + j, i - j + 300);
            }
    }

    vector<vector<int>> r(602, vector<int>(602));
    for(int i = 0; i < 601; ++i)
        for(int j = 0; j < 601; ++j)
            r[i + 1][j + 1] = v[i][j];
    for(int i = 0; i < 602; ++i)
        for(int j = 1; j < 602; ++j)
            r[i][j] += r[i][j - 1];
    for(int j = 0; j < 602; ++j)
        for(int i = 1; i < 602; ++i)
            r[i][j] += r[i - 1][j];

    i64 ans = 0;

    for(auto& elm : p){
        int x, y;
        tie(x, y) = elm;
        for(int d = 1; d <= 600; ++d){
            if(x + d <= 600 && y + d <= 600 && v[x + d][y])
                ans += r[x + 1][y + d] + r[x + d + 1][y + d + 1] - r[x + 1][y + d + 1] - r[x + d + 1][y + d];
            if(x + d <= 600 && y - d >= 0 && v[x + d][y])
                ans += r[x][y - d] + r[x + d][y - d + 1] - r[x][y - d + 1] - r[x + d][y - d];

            if(y + d <= 600 && x + d <= 600 && v[x][y + d])
                ans += r[x + d][y] + r[x + d + 1][y + d] - r[x + d][y + d] - r[x + d + 1][y];
            if(y + d <= 600 && x - d >= 0 && v[x][y + d])
                ans += r[x - d][y + 1] + r[x - d + 1][y + d + 1] - r[x - d][y + d + 1] - r[x - d + 1][y + 1];
        }
    }
    cout << ans << endl;
}
