#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define SIZE 200005
#define INF 1000000005LL
#define MOD 1000000007

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;


int h,w;
int H=430,W=430;
int a[310][310];

int b[2][450][450];

ll bw[2][450][450],bh[2][450][450];

void convert(){
  int t = (w-1)/2;
  rep(x,0,w) rep(y,0,h) if((x+y)%2 == 0){
    if(a[y][x]==1){
      b[0][(-x+y)/2+t+1][(x+y)/2+1] = 1;
      bw[0][(-x+y)/2+t+1][(x+y)/2+1] = 1;
      bh[0][(-x+y)/2+t+1][(x+y)/2+1] = 1;
    }
  }else{
    if(a[y][x]==1){
      b[1][(-x+1+y)/2+t][(x+1+y)/2] = 1;
      bw[1][(-x+1+y)/2+t][(x+1+y)/2] = 1;
      bh[1][(-x+1+y)/2+t][(x+1+y)/2] = 1;
    }
  }
  rep(i,0,H) rep(j,0,W-1) rep(k,0,2){
    bw[k][i][j+1] += bw[k][i][j];
  }
  rep(i,0,W) rep(j,0,H-1) rep(k,0,2){
    bh[k][j+1][i] += bh[k][j][i];
  }
}

int main(){
  cin >> h >> w;
  string s;
  rep(i,0,h){
    cin >> s;
    rep(j,0,w) {
      if(s[j]=='#') a[i][j] = 1;
    }
  }
  convert();

  ll n=0;

  rep(k,1,H){
    rep(i,1,H){
      rep(j,1,W){
        if(j+k>=H)break;
        rep(l,0,2){
          if(b[l][i][j]==1 && b[l][i][j+k]==1){
            if(i-k>=0) n += bw[l][i-k][j+k]-bw[l][i-k][j-1];
            if(i+k<W) n += bw[l][i+k][j+k]-bw[l][i+k][j-1];
          }
        }
      }
    }
  }
  rep(k,1,H){
    rep(i,1,H){
      rep(j,1,W){
        if(i+k>=H)break;
        rep(l,0,2){
          if(b[l][i][j]==1 && b[l][i+k][j]==1){
            if(j-k>=0) n += bh[l][i+k-1][j-k]-bh[l][i][j-k];
            if(j+k<W) n += bh[l][i+k-1][j+k]-bh[l][i][j+k];
          }
        }
      }
    }
  }

  cout << n << endl;

  return 0;
}
