#include <bits/stdc++.h>
using namespace std;
using vint = vector<long long>;
using vvint = vector<vint>;
using pint = pair<long long, long long>;
using vpint = vector<pint>;
template <typename T>
using priority_queue_rev = priority_queue<T, vector<T>, greater<T>>;
constexpr double PI = 3.1415926535897932384626433832795028;
constexpr long long DY[9] = {0, 1, 0, -1, 1, 1, -1, -1, 0};
constexpr long long DX[9] = {1, 0, -1, 0, 1, -1, -1, 1, 0};
long long gcd(long long a, long long b) {
  while (b) {
    swap(a %= b, b);
  }
  return a;
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long sgn(long long x) { return (x > 0) - (x < 0); }
template <typename T>
void fin(T mes) {
  cout << mes << endl;
  exit(0);
}
template <typename T, typename U>
bool chmax(T &a, const U &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T, typename U>
bool chmin(T &a, const U &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &rhs) {
  os << "(" << rhs.first << ", " << rhs.second << ")";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &rhs) {
  os << "{";
  for (auto itr = rhs.begin(); itr != rhs.end(); itr++) {
    os << *itr << (next(itr) != rhs.end() ? ", " : "");
  }
  os << "}";
  return os;
}
struct setup {
  static constexpr long long PREC = 20;
  setup() {
    cout << fixed << setprecision(PREC);
    cerr << fixed << setprecision(PREC);
  };
} setup;
long long H, W;
struct ha {
  long long operator()(pint p) const { return p.first * (H + W) + p.second; }
};
string S[330];
unordered_map<pint, long long, ha> s, cumA, cumB;
signed main() {
  cin >> H >> W;
  for (long long i = 0; i < (long long)(H); i++) {
    cin >> S[i];
    for (long long j = 0; j < (long long)(W); j++) {
      s[{i + j, i - j}] = S[i][j] == '#';
    }
  }
  for (long long i = 0; i < (long long)(H + W - 1); i++) {
    for (long long j = -W + 1; j < H; j++) {
      cumA[{i, j + 1}] += cumA[{i, j}] + s[{i, j}];
      cumB[{i + 1, j}] += cumB[{i, j}] + s[{i, j}];
    }
  }
  long long ans = 0;
  for (long long i = 0; i < (long long)(H + W - 1); i++) {
    for (long long j = -W + 1; j < H; j++) {
      for (long long k = j + 1; k < H; k++) {
        if (s[{i, j}] && s[{i, k}]) {
          ans += cumA[{i - (k - j), k + 1}] - cumA[{i - (k - j), j}];
          ans += cumA[{i + (k - j), k + 1}] - cumA[{i + (k - j), j}];
        }
      }
    }
  }
  for (long long i = -W + 1; i < H; i++) {
    for (long long j = 0; j < (long long)(H + W - 1); j++) {
      for (long long k = j + 1; k < H + W - 1; k++) {
        if (s[{j, i}] && s[{k, i}]) {
          ans += cumB[{k, i - (k - j)}] - cumB[{j + 1, i - (k - j)}];
          ans += cumB[{k, i + (k - j)}] - cumB[{j + 1, i + (k - j)}];
        }
      }
    }
  }
  cout << ans << endl;
}
