#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

const int N = 610;
int a[N][N], sr[N][N], sc[N][N];

bool isin(int i, int j){
    return i >= 0 && j >= 0 && i < N && j < N;
}

bool exist(int i, int j){
    return isin(i, j) && a[i][j];
}

int main() {
    int h, w;
    cin >> h >> w;
    REP(i,h){
        string s;
        cin >> s;
        REP(j,w){
            a[i+j][i-j+300] = (s[j] == '#');
        }
    }

    REP(i,N) REP(j,N-1) sr[i][j+1] = sr[i][j] + a[i][j];
    REP(j,N) REP(i,N-1) sc[i+1][j] = sc[i][j] + a[i][j];

    ll ans = 0, ans2 = 0;
    REP(i,N) REP(j,N){
        if (!a[i][j]) continue;
        FOR(d,1,N){
            ll tmp = 0;
            if (exist(i - d, j)){
                if (j + d < N) tmp += sc[i][j+d] - sc[i-d+1][j+d];
                if (j - d >= 0) tmp += sc[i][j-d] - sc[i-d+1][j-d];
            }
            if (exist(i + d, j)){
                if (j + d < N) tmp += sc[i+d][j+d] - sc[i+1][j+d];
                if (j - d >= 0) tmp += sc[i+d][j-d] - sc[i+1][j-d];
            }
            if (exist(i, j - d)){
                if (i + d < N) tmp += sr[i+d][j] - sr[i+d][j-d+1];
                if (i - d >= 0) tmp += sr[i-d][j] - sr[i-d][j-d+1];
            }
            if (exist(i, j + d)){
                if (i + d < N) tmp += sr[i+d][j+d] - sr[i+d][j+1];
                if (i - d >= 0) tmp += sr[i-d][j+d] - sr[i-d][j+1];
            }
            ans2 += (exist(i - d, j) + exist(i + d, j)) * (exist(i, j - d) + exist(i, j + d));
            ans += tmp;
        }
    }
    cout << ans / 2 + ans2 << endl;

    return 0;
}
