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 <iostream>
#include <algorithm>
using namespace std;

int H, W, N, p[609][609], q[609][609];

int vals(int px, int py) {
	px = min(px, 2 * N);
	py = min(py, 2 * N);
	if (px < 0 || py < 0) return 0;
	return p[px][py];
}

int valm(int px, int py) {
	if (px < 0 || py < 0 || px > 2 * N || py > 2 * N) return 0;
	return q[px][py];
}

int range_sum(int px, int py, int qx, int qy) {
	return vals(qx, qy) + vals(px - 1, py - 1) - vals(px - 1, qy) - vals(qx, py - 1);
}

int main() {
	cin >> H >> W; N = max(H, W);
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			char c; cin >> c;
			if (c == '#') { p[i + j][i - j + N] = 1; q[i + j][i - j + N] = 1; }
		}
	}
	for (int i = 0; i <= 2 * N; i++) {
		for (int j = 1; j <= 2 * N; j++) p[i][j] += p[i][j - 1];
	}
	for (int i = 0; i <= 2 * N; i++) {
		for (int j = 1; j <= 2 * N; j++) p[j][i] += p[j - 1][i];
	}

	long long ans = 0;
	for (int i = 0; i <= 2 * N; i++) {
		for (int j = 0; j <= 2 * N; j++) {
			int S = min({ i, j, 2 * N - i, 2 * N - j });
			for (int k = 1; k <= S; k++) {
				int V1 = valm(i - k, j - k) * valm(i - k, j + k) * range_sum(i + k, j - k, i + k, j + k);
				int V2 = valm(i + k, j - k) * valm(i + k, j + k) * range_sum(i - k, j - k, i - k, j + k);
				int V3 = valm(i - k, j - k) * valm(i + k, j - k) * range_sum(i - k + 1, j + k, i + k - 1, j + k);
				int V4 = valm(i - k, j + k) * valm(i + k, j + k) * range_sum(i - k + 1, j - k, i + k - 1, j - k);
				ans += (V1 + V2 + V3 + V4);
			}
		}
	}
	cout << ans << endl;
	return 0;
}