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 <string>
#include <vector>
#include <algorithm>

using namespace std;
using ll = long long;

static int table[300][600][301];

ll solve(vector<string> field){
	const int n = field.size(), m = field[0].size();
	for(int i = 0; i < n; ++i){ field[i] += string(n, '.'); }
	const int max_k = min(n, m);
	for(int k = 0; k < max_k; ++k){
		for(int x = 0; x < n + m; ++x){
			for(int y = 0; y < n; ++y){ table[k][x][y] = 0; }
		}
	}
	for(int k = 0; k < max_k; ++k){
		for(int x = 0; x < n + m; ++x){
			for(int y = 0; y < n; ++y){
				const int i0 = y, i1 = y + k;
				const int j0 = x - i0, j1 = x - i1;
				if(i1 >= n || j1 < 0){ continue; }
				if(field[i0][j0] != '#'){ continue; }
				if(field[i1][j1] != '#'){ continue; }
				table[k][x][y] += 1;
			}
		}
	}
	for(int k = 0; k < max_k; ++k){
		for(int x = 0; x < n + m; ++x){
			int acc = 0;
			for(int i = 0; i < n; ++i){
				const int t = table[k][x][i];
				table[k][x][i] = acc;
				acc += t;
			}
			table[k][x][n] = acc;
		}
	}
	ll answer = 0;
	for(int i = 0; i < n; ++i){
		for(int j = 0; j < m; ++j){
			if(field[i][j] != '#'){ continue; }
			for(int k = 0; k < max_k; ++k){
				const int y = i, x = j + i + k * 2;
				if(x >= n + m){ continue; }
				answer += table[k][x][min(n, i + k)];
				answer -= table[k][x][y];
			}
		}
	}
	return answer;
}

vector<string> rotate(const vector<string>& a){
	const int n = a.size(), m = a[0].size();
	vector<string> b(m, string(n, ' '));
	for(int i = 0; i < n; ++i){
		for(int j = 0; j < m; ++j){
			b[j][i] = a[i][m - 1 - j];
		}
	}
	return b;
}

int main(){
	ios_base::sync_with_stdio(false);
	int n, m;
	cin >> n >> m;
	vector<string> field(n);
	for(int i = 0; i < n; ++i){ cin >> field[i]; }
	ll answer = 0;
	answer += solve(field);
	field = rotate(field);
	answer += solve(field);
	field = rotate(field);
	answer += solve(field);
	field = rotate(field);
	answer += solve(field);
	cout << answer << endl;
	return 0;
}