#include <bits/stdc++.h>
#define int long long

#define TASKNAME ""

using namespace std;
const int K = 300;

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, m;
    cin >> n >> m;
    vector<bitset<K> > v;
    for (int i=0; i < n; i ++){
        string s;
        cin >> s;
        bitset<K> b;
        for (int j=0; j < m; j++){
            if (s[j] == '#') b[j] = 1;
        }
        v.push_back(b);
    }
    int ans = 0;
    bitset<K> a, b, c;
    for (int i=0; i < n; i++){
        for (int j=i; j < n; j++){
            for (int k=j; k < n; k++){
                if (i==k) continue;
                a = v[i], b = v[j], c = v[k];
                int d1 = j-i, d2 = k-j, s1, s2;
                if (d1 >= d2) s1 = d1, s2=2*d1-d2;
                else s1 = d1 + 2*(d2-d1), s2 = d2;
                //cout << i << " " << j << " " << k << " " << s1 << " " << s2 << endl;
                a <<= s1, c <<= s2;
                b &= a;
                b &= c;
                ans += b.count();
                if (d1==0 || d2==0) continue;
                a = v[i], b = v[j], c = v[k];
               // cout << a[1] << " " << s1 << endl;
                a >>= s1, c >>= s2;
                b &= a;
                b &= c;
                ans += b.count();
            }
        }
    }
    cout << ans;

}
