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:
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;
#define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i))
#define rep(i,j) FOR(i,0,j)
#define each(x,y) for(auto &(x):(y))
#define mp make_pair
#define MT make_tuple
#define all(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<(x)<<endl
#define smax(x,y) (x)=max((x),(y))
#define smin(x,y) (x)=min((x),(y))
#define MEM(x,y) memset((x),(y),sizeof (x))
#define sz(x) (int)(x).size()
#define RT return
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vll = vector<ll>;

const int DY[] = { -1,0,1,0 };
const int DX[] = { 0,1,0,-1 };

int H, W;
string S[301];

bool f(int y, int x) {
    return y >= 0 && x >= 0 && y < H&&x < W&&S[y][x] == '#';
}

ll g() {
    int N = H + W;
    vector<vll> sum(N, vll(N));
    rep(i, N) {
        // x+y=i
        // i-y>=0 y<=i
        rep(y, N - 1) {
            int x = i - y;
            sum[i][y + 1] = sum[i][y] + f(y, x);
        }
    }

    ll res = 0;
    rep(y, H)rep(x, W) {
        if (!f(y, x))continue;
        FOR(i, 1, min(H, W)) {
            int yy = y - i;
            int xx = x + i;
            if (!f(yy, xx))continue;
            for (int j : {i, -i}) {
                if (f(y + j, x + j))res++;
                if (f(yy + j, xx + j))res++;
                int k = x + y + j * 2;
                int lb = max(yy + j + 1, 0);
                int ub = y + j;
                if (k >= 0 && k < N && lb < ub) {
                    res += (sum[k][ub] - sum[k][lb]) * 2;
                }
            }
        }
    }
    return res;
}

void solve() {
    cin >> H >> W;
    rep(y, H)cin >> S[y];
    ll ans = g();
    reverse(S, S + H);
    ans += g();
    ans /= 2;
    cout << ans << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}