#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    int H, W;
    vector<vector<int> > mark;
    vector<vector<int> > ruir;
    vector<vector<int> > ruid;

    void input() {
        cin >> H >> W;
        mark.resize(H + W, vector<int>(H + W));
        ruir.resize(H + W, vector<int>(H + W));
        ruid.resize(H + W, vector<int>(H + W));

        for (int i = 0; i < H; ++i) {
            for (int j = 0; j < W; ++j) {
                char tmp;
                cin >> tmp;
                if (tmp == '#') {
                    mark[i + j][H - i + j] = ruir[i + j][H - i + j] = ruid[i + j][H - i + j] = 1;
//                    mark[i + j][W + i - j]
                }
            }
        }


    }


    void solve() {
        input();
        for (int i = 0; i < ruir.size(); ++i) {
            for (int j = 0; j < ruir[i].size() - 1; ++j) {
                ruir[i][j + 1] += ruir[i][j];
            }
        }

        for (int j = 0; j < ruid[0].size(); ++j) {
            for (int i = 0; i < ruid.size() - 1; ++i) {
                ruid[i + 1][j] += ruid[i][j];
            }
        }

//        for (int i = 0; i < mark.size(); ++i) {
//            for (int j = 0; j < mark[i].size(); ++j) {
//                cout << mark[i][j];
//            }
//            cout << endl;
//        }
        ll ans = 0;
        for (int i = 0; i < mark.size(); ++i) {
            for (int j = 0; j < mark[0].size(); ++j) {
                if (mark[i][j]) {
                    for (int t = 1; j + t < mark[0].size(); ++t) {
                        if (mark[i][j + t]) {
                            if (i + t < mark.size()) {
                                ans += ruir[i + t][j + t - 1] - ruir[i + t][j];
                            }
                            if (i - t >= 0) {
                                ans += ruir[i - t][j + t - 1] - ruir[i - t][j];
                            }
                        }
                    }

                    for (int t = 1; i + t < mark.size(); ++t) {
                        if (mark[i + t][j]) {
                            if (j + t < mark[0].size()) {
                                ans += ruid[i + t - 1][j + t] - ruid[i][j + t];
                            }
                            if (j - t >= 0) {
                                ans += ruid[i + t - 1][j - t] - ruid[i][j - t];
                            }
                        }
                    }
                }
            }
        }


        for (int i = 0; i < mark.size(); ++i) {
            for (int j = 0; j < mark[0].size(); ++j) {
                for (int t = 1; i + t < mark.size() && j + t < mark[0].size(); ++t) {
                    int cnt = 0;
                    if (mark[i][j]) cnt++;
                    if (mark[i + t][j]) cnt++;
                    if (mark[i][j + t])cnt++;
                    if (mark[i + t][j + t]) cnt++;
                    cnt = max(0, cnt - 2);
                    if (cnt == 1) ans++;
                    if (cnt == 2) ans += 4;
                }
            }
        }

        cout << ans << endl;
    }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    Solve().solve();


    return 0;
}


Measured memory_bytes: 6528