#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
using Value = int;
const Value ini = 0;
struct segtree {
  int N;
  vector<Value> dat;
  segtree() {}
  segtree(int n) : dat(2 * (1 << 18)) {
    N = 1;
    while (N < n) N *= 2;
    for (int i = 0; i < 2 * N - 1; i++) {
      dat[i] = ini;
    }
  }
  Value connect(const Value& l, const Value& r) { return l + r; }
  void update(int k, Value a) {
    k += N - 1;
    dat[k] = a;
    while (k > 0) {
      k = (k - 1) / 2;
      const Value al(dat[k * 2 + 1]);
      const Value ar(dat[k * 2 + 2]);
      dat[k] = connect(al, ar);
    }
  }
  Value query(int a, int b) { return query(a, b, 0, 0, N); }
  Value query(int a, int b, int k, int l, int r) {
    if (r <= a or b <= l) return ini;
    if (a <= l and r <= b) return dat[k];
    const int m = (l + r) / 2;
    const Value al(query(a, b, k * 2 + 1, l, m));
    const Value ar(query(a, b, k * 2 + 2, m, r));
    return connect(al, ar);
  }
};
vector<vector<int>> get_fi(const vector<vector<int>> field, bool flag) {
  int sum = max(field.size(), field[0].size());
  vector<vector<int>> newfield(2 * sum, vector<int>(2 * sum));
  for (int y = 0; y < field.size(); ++y) {
    for (int x = 0; x < field[0].size(); ++x) {
      if (flag)
        newfield[y + x][sum + y - x] += field[y][x];
      else
        newfield[sum + y - x][y + x] += field[y][x];
    }
  }
  return newfield;
}
bool valid(const vector<vector<int>>& field, int y, int x) {
  return y >= 0 && y < field.size() && x >= 0 && x < field[0].size();
}
int solve(vector<vector<int>> field) {
  vector<segtree> segs(field.size(), segtree(field[0].size()));
  for (int y = 0; y < field.size(); ++y) {
    for (int x = 0; x < field[0].size(); ++x) {
      segs[y].update(x, field[y][x]);
    }
  }
  int ans = 0;
  for (int y = 0; y < field.size(); ++y) {
    for (int l = 0; l < field[y].size(); ++l) {
      if (!field[y][l]) continue;
      for (int r = l + 1; r < field[y].size(); ++r) {
        if (!field[y][r]) continue;
        {
          {
            int ny = y - (r - l);
            if (valid(field, ny, l)) {
              ans += segs[ny].query(l, l + 1);
              ans += segs[ny].query(r, r + 1);
              ans += 2 * segs[ny].query(l + 1, r);
            }
          }
          {
            int ny = y + (r - l);
            if (valid(field, ny, l)) {
              ans += segs[ny].query(l, l + 1);
              ans += segs[ny].query(r, r + 1);
              ans += 2 * segs[ny].query(l + 1, r);
            }
          }
        }
      }
    }
  }
  return ans;
}
int main() {
  int H, W;
  cin >> H >> W;
  vector<vector<int>> field(H, vector<int>(W));
  for (int i = 0; i < H; ++i) {
    string st;
    cin >> st;
    for (int j = 0; j < W; ++j) {
      field[i][j] = st[j] == '#';
    }
  }
  int ans = 0;
  auto nfield = get_fi(field, false);
  ans += solve(nfield);
  nfield = get_fi(field, true);
  ans += solve(nfield);
  cout << ans / 2 << endl;
  return 0;
}
