#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define show(x) cout << #x << " = " << (x) << endl;
using namespace std;
using ll = long long;
using pii = pair<int,int>;
vector<string>s;
int a[605][605];
int ruiseki[605][605];
int n;
ll ans;
void rot(){
    int temp[605][605];
    rep(i,n){
        rep(j,n){
            temp[i][j] = a[j][n-1-i];
        }
    }
    swap(temp,a);
}
void cal(){
    memset(ruiseki,0,sizeof(ruiseki));
    rep(i,n){
        ruiseki[i][0] = 0;
        rep(j,n){
            ruiseki[i][j+1] = ruiseki[i][j] + a[i][j];
        }
    }
    /*rep(i,n){
        rep(j,n+1){
            cout << ruiseki[i][j];
        }
        cout << endl;
    }*/
    rep(i,n){
        rep(j,n){
            if(a[i][j] == 0)continue;
            for(int k = j + 1; k < n; k++){
                if(a[i][k] == 0)continue;
                if(i+k-j<n){
                    ans += ruiseki[i+k-j][k]-ruiseki[i+k-j][j];
                }
            }
        }
    }
}
int main(){
    int h,w;
    cin >> h >> w;
    s.resize(h);
    rep(i,h)cin >> s[i];
    rep(i,h){
        rep(j,w){
            a[i+j][i-j+w-1] = (s[i][j] == '#' ? 1 : 0);
        }
    }
    n = h + w;
    /*rep(i,n){
        rep(j,n){
            cout << a[i][j];
        }
        cout << endl;
    }*/
    rep(i,4){
        cal();
        rot();
    }
    cout << ans << endl;
}