#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
template<typename T> istream& operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream& operator<<(ostream &os, vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream& operator<<(ostream &os, set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream& operator<<(ostream &os, pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream& operator<<(ostream &os, map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl;


vector<vector<int>> uv(601, vector<int>(601));

lint coun(int x, int d)
{
    lint ans = 0;
    int s = 0, t = abs(d);
    
    lint eff = 0;
    REP(i, min(t, 601)) eff += uv[x + d][i];
    
    while (t < 601)
    {
        eff += uv[x + d][t];
        if (uv[x][s] && uv[x][t])
        {
            ans += eff * 2 - uv[x + d][s] - uv[x + d][t];
        }        
        eff -= uv[x + d][s];
        s++; t++;
    }
    return ans;
}

lint solve()
{
    lint ans = 0;
    REP(x, 601) FOR(d, 1, 601)
    {
        if (x - d >= 0) ans += coun(x, -d);
        if (x + d < 601) ans += coun(x, d);
    }
    return ans;
}

int main()
{
    int H, W;
    cin >> H >> W;
    REP(h, H)
    {
        string S;
        cin >> S;
        REP(w, W) if (S[w] == '#')
        {
            int u = h + w;
            int v = h - w + 301;
            uv[u][v] = 1;
        }
    }

    lint ans1 = solve();
    REP(i, 601) REP(j, i) swap(uv[i][j], uv[j][i]);
    lint ans2 = solve();
    cout << (ans1 + ans2) / 2 << endl;
}
