//E
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807

int H,W;
string s[300];
vector<pair<int,int>> coin;

int d(int x1, int x2, int y1, int y2){
    return abs(x1 - x2) + abs(y1 - y2);
}

int main(){
    
    cin >> H >> W;
    for(int i=0; i<H; i++){
        cin >> s[i];
        for(int j=0; j<W; j++){
            if(s[i][j] == '#') coin.push_back(make_pair(i,j));
        }
    }

    LL ans = 0;
    for(int i=0; i<coin.size(); i++){
        for(int j=i+1; j<coin.size(); j++){
            int dis = d(coin[i].first, coin[j].first, coin[i].second, coin[j].second);
            if(coin[i].second - coin[j].second < 0){
                int h = coin[i].first;
                int w = coin[i].second - (coin[i].second - coin[j].second);
                if(d(h, coin[j].first, w, coin[j].second) == d && s[h][w]=='#') ans++;
                while(h < coin[j].first){
                    h++;
                    w++;
                    if(d(h, coin[j].first, w, coin[j].second) == d && s[h][w]=='#') ans++;
                }
            }
            else{
                int h = coin[i].first;
                int w = coin[i].second + (coin[i].second - coin[j].second);
                if(d(h, coin[j].first, w, coin[j].second) == d && s[h][w]=='#') ans++;
                while(h < coin[j].first){
                    h++;
                    w--;
                    if(d(h, coin[j].first, w, coin[j].second) == d && s[h][w]=='#') ans++;
                }
            }
        }
    }
    cout << ans << endl;
    
    return 0;
}