#include <bits/stdc++.h>

using namespace std;

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL 9223372036854775
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define MOD 10000
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

#define int long long

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a)  begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

const int MAX_H = 310;
const int MAX_W = 310;

const int MAX_T = MAX_H*2;

int H, W;
char Field[MAX_H][MAX_W];

int T_Field[MAX_T][MAX_T];
int T_Sum[MAX_T][MAX_T];
int T_SumW[MAX_T][MAX_T];
int T_SumH[MAX_T][MAX_T];

int getT(int sx, int sy, int gx, int gy) {
  return T_Sum[gy][gx] - T_Sum[gy][sx] - T_Sum[sy][gx] + T_Sum[sy][sx];
}

signed main() {
  cin >> H >> W;
  REP(y,H) {
    REP(x,W) {
      cin >> Field[y][x];
      if(Field[y][x] == '#') {
        T_Field[x+y+2][y-x+MAX_W] = T_SumH[x+y+2][y-x+MAX_W] = T_SumW[x+y+2][y-x+MAX_W] =1;
      }
    }
  }

  REP(y,MAX_T-1) {
    REP(x,MAX_T-1) {
      T_SumH[y+1][x] += T_SumH[y][x];
      T_SumW[y][x+1] += T_SumW[y][x];
    }
  }

  REP(y,MAX_T-1) {
    REP(x,MAX_T-1) {
      T_Sum[y+1][x+1] = T_Sum[y+1][x] + T_Sum[y][x+1] - T_Sum[y][x] + T_Field[y][x];
    }
  }

  int ans = 0;
  REP(y,MAX_T) {
    REP(x,MAX_T) {
      if(T_Field[y][x] == 0) {
        continue;
      }
      FOR(nx,x+1,MAX_T) {
        int d = nx - x;
        if(T_Field[y][nx] == 0) {
          continue;
        }
        if(0 <= y-d) {
          ans += T_SumW[y-d][nx] - T_SumW[y-d][x-1];
          // ans += getT(x,y-d,nx+1,y-d+1);
        }
        if(y+d < MAX_T) {
          ans += T_SumW[y+d][nx] - T_SumW[y+d][x-1];
          // ans += getT(x,y+d,nx+1,y+d+1);
        }
      }
      FOR(ny,y+1,MAX_T) {
        int d = ny - y;
        if(T_Field[ny][x] == 0) {
          continue;
        }
        if(0 <= x-d) {
          ans += T_SumH[ny-1][x-d] - T_SumH[y][x-d];
          // ans += getT(x-d, y+1, x-d+1, ny);
        }
        if(x+d < MAX_T) {
          ans += T_SumH[ny-1][x+d] - T_SumH[y][x+d];
          // ans += getT(x+d, y+1, x+d+1, ny);
        }
      }
    }
  }

  cout << ans << endl;

  return 0;
}