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 <bits/stdc++.h>
#define LL long long
#define ri register int
#define pii pair<int, int>
#define pll pair<LL, LL>
using namespace std;
inline int read()
{
	int ret = 0; char ch = getchar();
	while(ch < '0' || ch > '9')
		ch = getchar();
	do {
		ret = ret * 10 + ch - '0';
		ch = getchar();
	} while('0' <= ch && ch <= '9');
	return ret;
}
inline void write(int x) // x > 0 (x != 0) ***
{
	if(!x)
		return ;
	write(x / 10);
	putchar(x % 10 + '0');
}
#define maxn 1010
#define hshs 310
int n, m;
int a[maxn][maxn];
int s1[maxn][maxn], s2[maxn][maxn];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> n >> m;
	string s;
	for(int i = 1; i <= n; i ++)
	{
		cin >> s;
		for(int j = 1; j <= m; j ++)
		{
			a[hshs + i][hshs + j] = s[j - 1] == '#';
		}
	}
	for(int i = 1; i <= n + 2 * hshs; i ++)
	{
		for(int j = 1; j <= m + 2 * hshs; j ++)
			s1[i][j] = s1[i - 1][j - 1] + a[i][j];
		for(int j = m + 2 * hshs; j; j --)
			s2[i][j] = s2[i - 1][j + 1] + a[i][j];
	}
	int Ans = 0;
	for(int i = 1; i <= n; i ++)
		for(int j = 1; j <= m; j ++)
			for(int k = 1; k <= min(n, m); k ++)
			{
//				cout << i << ' ' << j << ' ' << k << ' ' << Ans << endl;
				if(i - k > 0 && j - k > 0 && a[hshs + i][hshs + j - k] && a[hshs + i - k][hshs + j])
					Ans += s2[hshs + i + k - 1][hshs + j + 1] - s2[hshs + i - 1][hshs + j + k + 1];
				if(i - k > 0 && j + k <= m && a[hshs + i][hshs + j + k] && a[hshs + i - k][hshs + j])
					Ans += s1[hshs + i + k][hshs + j] - s1[hshs + i][hshs + j - k];
				if(i + k <= n && j + k <= m && a[hshs + i][hshs + j + k] && a[hshs + i + k][hshs + j])
					Ans += s2[hshs + i][hshs + j - k] - s2[hshs + i - k][hshs + j];
				if(i + k <= n && j - k > 0 && a[hshs + i][hshs + j - k] && a[hshs + i + k][hshs + j])
					Ans += s1[hshs + i - 1][hshs + j + k - 1] - s1[hshs + i - k - 1][hshs + j - 1];
			}
	cout << Ans << endl;
	return 0;
}