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"
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
const ll MOD = 998244353;
typedef pair<int, int> P;
bool exist[600][600];
int x[600][600];
int y[600][600];
int main() {
	int H, W;
	cin >> H >> W;
	vector<string> s(H);
	for (int i = 0; i < H; i++) cin >> s[i];
	vector<P> coin;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (s[i][j] == '#') {
				int nx = j - i + 300, ny = j + i;
				x[ny][nx]++;
				y[ny][nx]++;
				exist[ny][nx] = 1;
				coin.emplace_back(nx, ny);
			}
		}
	}
	for (int i = 0; i < 600; i++) {
		for (int j = 1; j < 600; j++) {
			x[i][j] += x[i][j - 1];
		}
	}
	for (int i = 0; i < 600; i++) {
		for (int j = 1; j < 600; j++) {
			y[j][i] += y[j - 1][i];
		}
	}
	ll ans = 0;
	ll t = 0;
	for (int d = 1; d < 600; d++) {
		for (P p : coin) {
			if (p.first + d < 600 && exist[p.second][p.first + d]) {
				if (p.second + d < 600) {
					ans += x[p.second + d][p.first + d];
					if (p.first > 0) ans -= x[p.second + d][p.first - 1];
				}
				if (p.second - d >= 0) {
					ans += x[p.second - d][p.first + d];
					if (p.first > 0) ans -= x[p.second - d][p.first - 1];
				}
			}
			if (p.second + d < 600 && exist[p.second + d][p.first]) {
				if (p.first + d < 600) {
					ans += y[p.second + d][p.first + d];
					if (p.second > 0) ans -= y[p.second - 1][p.first + d];
				}
				if (p.first - d >= 0) {
					ans += y[p.second + d][p.first - d];
					if (p.second > 0) ans -= y[p.second - 1][p.first - d];
				}
			}
			for (int i = -1; i <= 1; i += 2) {
				int x = p.first + d * i;
				if (x < 0 || x >= 600 || !exist[p.second][x]) continue;
				for (int j = -1; j <= 1; j += 2) {
					int y = p.second + d * j;
					if (y < 0 || y >= 600 || !exist[y][p.first]) continue;
					t++;
				}
			}
		}
	}
	ans -= t;
	cout << ans << endl;
 }