#include <bits/stdc++.h>
using namespace std;
int field[305][305];
int tmp[305][305];
long long sum[605][605];
int main() {
  int H, W;
  cin >> H >> W;
  for (int i = (0); i < (int)(H); i++) {
    string s;
    cin >> s;
    for (int j = (0); j < (int)(W); j++) {
      if (s[j] == '#') {
        field[i][j] = 1;
        tmp[i][j] = 1;
      }
    }
  }
  long long ret = 0;
  for (int k = (0); k < (int)(4); k++) {
    for (int i = (0); i < (int)(605); i++) {
      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++;
      }
      for (int j = (x); j < (int)(605); j++) {
        sum[i][j] = sum[i][x - 1];
      }
    }
    for (int i = (0); i < (int)(305); i++) {
      for (int j = (0); j < (int)(305); j++) {
        if (field[i][j] == 1) {
          int y = i - 1, x = j + 1;
          while (y >= 0) {
            if (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;
              if (0 <= z) {
                int acnt = 0;
                if (0 <= ax - 1 && ax - 1 < 605) acnt = sum[z][ax - 1];
                if (605 <= ax - 1) acnt = sum[z][604];
                int bcnt = 0;
                if (0 <= bx - 1 && bx - 1 < 605) bcnt = sum[z][bx - 1];
                if (605 <= bx - 1) bcnt = sum[z][604];
                ret += bcnt - acnt;
              }
            }
            y--;
            x++;
          }
        }
      }
    }
    for (int i = (0); i < (int)(305); i++) {
      for (int j = (0); j < (int)(305); j++) {
        tmp[j][304 - i] = field[i][j];
      }
    }
    for (int i = (0); i < (int)(305); i++) {
      for (int j = (0); j < (int)(305); j++) {
        field[i][j] = tmp[i][j];
      }
    }
  }
  cout << ret << endl;
  return 0;
}
