#include <bits/stdc++.h>
const long long INF = 1e9;
const long long MOD = 1e9 + 7;
const long long LINF = 1e18;
using namespace std;
void CINT() {}
template <class Head, class... Tail>
void CINT(Head&& head, Tail&&... tail) {
  cin >> head;
  CINT(move(tail)...);
}
template <class T = long long>
T IN() {
  T x;
  cin >> x;
  return (x);
}
template <class Head>
void VT(Head head) {}
template <class Head, class Seco, class... Tail>
void VT(Head&& head, Seco&& seco, Tail&&... tail) {
  seco.resize(head);
  VT(head, move(tail)...);
}
void VT2() {}
template <class Head, class... Tail>
void VT2(Head&& head, Tail&&... tail) {
  for (auto& youso_ : (head)) cin >> youso_;
  VT2(move(tail)...);
}
template <class Head>
void VT3(Head&& head) {}
template <class Head, class Seco, class... Tail>
void VT3(Head&& head, Seco&& seco, Tail&&... tail) {
  seco[head] = IN();
  VT3(head, move(tail)...);
}
double eps = 1e-6;
signed main() {
  int h, w;
  cin >> h >> w;
  vector<string> v(h);
  for (auto& youso_ : (v)) cin >> youso_;
  std::vector<std::pair<int, int>> poses;
  for (long long i = 0; i < (h); ++i)
    for (long long j = 0; j < (w); ++j)
      if (v[i][j] == '#') poses.emplace_back(i, j);
  int t = poses.size();
  long long ans = 0;
  for (long long i = 0; i < (t); ++i) {
    for (long long j = (i + 1); j < (t); ++j) {
      int len = std::abs(poses[i].first - poses[j].first) +
                std::abs(poses[i].second - poses[j].second);
      std::pair<int, int> kat(poses[i].first - poses[j].first,
                              poses[i].second - poses[j].second);
      std::pair<double, double> cent(
          1.0 * (poses[i].first + poses[j].first) / 2,
          1.0 * (poses[i].second + poses[j].second) / 2);
      double veclen = sqrt(cent.first * cent.first + cent.second * cent.second);
      auto cent2 = cent;
      cent.first -= len * kat.first / veclen;
      cent.second -= len * kat.second / veclen;
      cent2.first += len * kat.first / veclen;
      cent2.second += len * kat.second / veclen;
      if (cent.first + eps >= int(cent.first) &&
          cent.first - eps <= int(cent.first) &&
          cent.second + eps >= int(cent.second) &&
          cent.second - eps <= int(cent.first)) {
        if (cent.first < 0 || cent.second < 0 || cent.first >= h ||
            cent.second >= w)
          continue;
        if (v[round(cent.first)][round(cent.second)] == '#') {
          ++ans;
        }
      }
      if (cent2.first + eps >= int(cent2.first) &&
          cent2.first - eps <= int(cent2.first) &&
          cent2.second + eps >= int(cent2.second) &&
          cent2.second - eps <= int(cent2.first)) {
        if (cent2.first < 0 || cent2.second < 0 || cent2.first >= h ||
            cent2.second >= w)
          continue;
        if (v[round(cent2.first)][round(cent2.second)] == '#') {
          ++ans;
        }
      }
    }
  }
  cout << (ans) << endl;
}
