#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

int field[305][305];
int tmp[305][305];

ll sum[610][610];

int main(){
  int H, W;
  cin >> H >> W;
  rep(i,H){
    string s;
    cin >> s;
    rep(j,W){
      if(s[j] == '#'){
        field[i][j] = 1;
      }
    }
  }

  ll ret = 0;
  rep(k,4){
    rep(i,610){
      int y = i, x = 0;
      while(y >= 0){
        sum[i][x] = ((x==0)?0:sum[i][x-1]);
        if(0 <= y && y < 305 && 0 <= x && x < 305){
          if(field[y][x] == 1){
            sum[i][x]++; 
          }
        }
        y--;
        x++;
      }
      REP(j,x,610){
        sum[i][j] = sum[i][x-1];
      }
    }
    rep(i,305){
      rep(j,305){
        if(field[i][j] == 1){
          //cout << "\t" << i << " " << j << endl;
          int y = i-1, x = j+1;
          while(y >= 0){
            if((0<=y&&y<305&&0<=x&&x<305) && field[y][x] == 1){
              int dist = abs(x-j);

              int ay = i-dist, ax = j-dist;
              int by = y-dist, bx = x-dist;
              int z = ay + ax;
              //cout << "\t\t" << z << " " << ay << " " << ax << " " << by << " " << bx << endl;
              if(0 <= z){
                ll acnt = 0;
                if(0<=ax-1 && ax-1<610) acnt = sum[z][ax-1];
                if(610 <= ax-1) acnt = sum[z][609];
                ll bcnt = 0;
                if(0<=bx-1 && bx-1<610) bcnt = sum[z][bx-1];
                if(610 <= bx-1) bcnt = sum[z][609];
                ret += bcnt - acnt;
                //if(bcnt-acnt > 0) cout << i << " " << j << " " << y << " " << x << " " << bcnt-acnt << endl;
              }
            }
            y--;
            x++;
          }
        }
      }
    }

    rep(i,305){
      rep(j,305){
        tmp[j][304-i] = field[i][j];
      }
    }
    rep(i,305){
      rep(j,305){
        field[i][j] = tmp[i][j];
      }
    }

  }

  cout << ret << endl;
  
  return 0;
}
