#include <bits/stdc++.h>
using namespace std;
int n, m, pref[2][605][605];
long long sum = 0;
char a[605][605];
bool check(int x, int y) { return (x >= 1 && y >= 1 && x <= n && y <= m); }
int main() {
  cin.tie(0), ios::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) cin >> a[i][j];
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (a[i][j] == '#') {
        pref[0][i][j] = 1;
      }
      pref[0][i][j] += pref[0][i - 1][j - 1];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = m; j >= 1; j--) {
      if (a[i][j] == '#') {
        pref[1][i][j] = 1;
      }
      pref[1][i][j] += pref[1][i - 1][j + 1];
    }
  }
  for (int range = 1; range <= max(n, m); range++) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        int x1 = i, y1 = j - range;
        int x2 = i - range, y2 = j;
        int x3 = i, y3 = j + range;
        int x4 = i + range, y4 = j;
        if (check(x1, y1) && check(x2, y2) && a[x1][y1] == '#' &&
            a[x2][y2] == '#')
          sum += pref[1][x4][y4] - pref[1][x3 - 1][y3 + 1];
        if (check(x1, y1) && check(x4, y4) && a[x1][y1] == '#' &&
            a[x4][y4] == '#')
          sum += pref[0][x3][y3] - pref[0][x2 - 1][y2 - 1];
        if (check(x3, y3) && check(x4, y4) && a[x3][y3] == '#' &&
            a[x4][y4] == '#')
          sum += pref[1][x1][y1] - pref[1][x2 - 1][y2 + 1];
        if (check(x2, y2) && check(x3, y3) && a[x2][y2] == '#' &&
            a[x3][y3] == '#')
          sum += pref[0][x4][y4] - pref[0][x1 - 1][y1 - 1];
      }
    }
  }
  cout << sum;
}
