Problem: There are some coins in the xy-plane. The positions of the coins are represented by a grid of characters with H rows and W columns. If the character at the i-th row and j-th column, s_{ij}, is `#`, there is one coin at point (i,j); if that character is `.`, there is no coin at point (i,j). There are no other coins in the xy-plane.

There is no coin at point (x,y) where 1\leq i\leq H,1\leq j\leq W does not hold. There is also no coin at point (x,y) where x or y (or both) is not an integer. Additionally, two or more coins never exist at the same point.

Find the number of triples of different coins that satisfy the following condition:

* Choosing any two of the three coins would result in the same Manhattan distance between the points where they exist.



Here, the Manhattan distance between points (x,y) and (x',y') is |x-x'|+|y-y'|. Two triples are considered the same if the only difference between them is the order of the coins.

Constraints

* 1 \leq H,W \leq 300
* s_{ij} is `#` or `.`.

Input

Input is given from Standard Input in the following format:


H W
s_{11}...s_{1W}
:
s_{H1}...s_{HW}


Output

Print the number of triples that satisfy the condition.

Examples

Input

5 4
#.##
.##.
#...
..##
...#


Output

3


Input

5 4
.##
.##.
...
..##
...#


Output

3


Input

13 27
......#.........#.......#..
...#.....###..
..............#####...##...
...#######......#...#######
...#.....#.....###...#...#.
...#######....#.#.#.#.###.#
..............#.#.#...#.#..
.#.#.#...###..
...........#...#...#######
..#######..#...#...#.....#
..#.....#..#...#...#.###.#
..#######..#...#...#.#.#.#
..........##...#...#.#####


Output

870

Solution (in CPP):

Solution:
/**
 * 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;
}