#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>
#include <bitset>
#include <cstdint>

using namespace std;
using i64 = int64_t;
using i32 = int32_t;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (size_t i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

i64 h, w;
vector<string> s, ss;
i64 sum[301][601];
int main() {
  cin >> h >> w;
  read_n(s, h);
  i64 ans = 0;

  ss = s;
  i64 dup = 0;
  for (i64 dir = 0; dir < 2; ++dir) {
    for (i64 i = 0; i < h; ++i) {
      string p = string(i, ' '), q = string(h - i - 1, ' ');
      s[i] = p + s[i] + q;
    }

    for (i64 j = 0; j < s[0].size(); ++j) {
      for (i64 i = 1; i <= h; ++i) {
        sum[i][j] = sum[i - 1][j] + (s[i - 1][j] == '#' ? 1 : 0);
      }
    }

    for (i64 j = 0; j < s[0].size(); ++j) {
      for (i64 i = 0; i < h; ++i) {
        if (s[i][j] == '#') for (i64 k = i + 1; k < h; ++k) {
          if (s[k][j] == '#') {
            i64 l = j + 2 * (k - i), m = j - 2 * (k - i);
            if (l < s[0].size()) {
              ans += sum[min(h, k + (k - i + 1))][l] - sum[k][l];
              if (s[k][l] == '#') dup++;
              if (k + (k - i) < h && s[k + (k - i)][l] == '#') dup++;
            }
            if (m >= 0) {
              ans += sum[i + 1][m] - sum[max(i64(0), i - (k - i))][m];
              if (s[i][m] == '#') dup++;
              if (i - (k - i) >= 0 && s[i - (k - i)][m] == '#') dup++;
            }
          }
        }
      }
    }
    
    s = ss;
    for (auto& t : s) reverse(begin(t), end(t));
  }

  cout << ans - dup / 2 << '\n';
  return 0;
}
