/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aajisaka
 */

#include<bits/stdc++.h>

using namespace std;

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define SPEED ios_base::sync_with_stdio(false);cin.tie(nullptr)
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;

constexpr long double PI = 3.14159265358979323846264338327950288L;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

class EEquilateral {
public:
    void solve(istream& cin, ostream& cout) {
      SPEED;
      int h, w; cin >> h >> w;
      vector<vector<int>> mat(600, vector<int>(600));
      rep(i, h) {
        rep(j, w) {
          char c; cin >> c;
          if (c == '#') {
            mat[i+j][i-j+300] = 1;
            debug(i+j, i-j+300);
          }
        }
      }

      vector<vector<int>> mat1(601, vector<int>(601));
      rep(i, 600) {
        rep(j, 600) {
          mat1[i][j+1] += mat1[i][j] + mat[i][j];
        }
      }
      vector<vector<int>> mat2(601, vector<int>(601));
      rep(j, 600) {
        rep(i, 600) {
          mat2[i+1][j] += mat2[i][j] + mat[i][j];
        }
      }

      ll ret = 0;
      rep(i, 600) {
        rep(j, 600) {
          for(int k=j+1; k<600; k++) {
            if (mat[i][j] && mat[i][k]) {
              int d = k-j;
              if (i-d >= 0) {
                ret += mat1[i-d][k+1] - mat1[i-d][j];
              }
              if (i+d < 600) {
                ret += mat1[i+d][k+1] - mat1[i+d][j];
              }
            }
            if (mat[j][i] && mat[k][i]) {
              int d = k-j;
              if (i-d >= 0) {
                ret += mat2[k][i-d] - mat2[j+1][i-d];
              }
              if (i+d < 600) {
                ret += mat2[k][i+d] - mat2[j+1][i+d];
              }
            }
          }
        }
      }
      cout << ret << endl;



    }
};

signed main() {
  EEquilateral solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}