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:
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
#define MOD @
#define ADD(X,Y) ((X) = ((X) + (Y)%MOD) % MOD)
typedef long long i64; typedef vector<int> ivec; typedef vector<string> svec;

int H, W, N;
char S[330][330];
int A[620][620];
int acc[620][620];

i64 ret;

void solve()
{
	for (int i = 0; i < N; ++i) {
		acc[i][0] = 0;
		for (int j = 0; j < N; ++j) {
			acc[i][j + 1] = acc[i][j] + A[i][j];
		}
	}

	for (int y = 0; y < N; ++y) {
		for (int x = 0; x < N; ++x) {
			if (A[y][x] == 0) continue;
			for (int x2 = x + 1; x2 < N; ++x2) {
				if (A[y][x2] == 0) continue;

				int d = x2 - x;
				if (y + d < N) {
					ret += acc[y + d][x2] - acc[y + d][x + 1];
					ret += A[y + d][x];
				}
			}
		}
	}
}
int A2[620][620];
void rot()
{
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			A2[i][j] = A[j][N - 1 - i];
		}
	}
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			A[i][j] = A2[i][j];//[j][N - 1 - i];
		}
	}
}
int main()
{
	scanf("%d%d", &H, &W);
	for (int i = 0; i < H; ++i) scanf("%s", S[i]);

	N = H + W;
	for (int i = 0; i < H; ++i) {
		for (int j = 0; j < W; ++j) {
			if (S[i][j] == '#') {
				int x = i + j;
				int y = i - j + W - 1;
				A[x][y] = 1;
			}
		}
	}

	ret = 0;
	solve(); rot();
	solve(); rot();
	solve(); rot();
	solve(); rot();

	printf("%lld\n", ret);

	return 0;
}