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
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#define int long long
#define rep(i, n) for(i = 0; i < n; i++)
using namespace std;

int h, w;
string tmp[300];
char s[666][666];
int N;
int imosR[1444][1444];
int imosC[1444][1444];

signed main() {
	int i, j;
	
	cin >> h >> w;
	rep(i, h) cin >> tmp[i];
	
	rep(i, h) {
		rep(j, w) {
			int i2 = i + j;
			int j2 = i - j + w - 1;
			s[i2][j2] = tmp[i][j];
		}
	}
	N = h + w - 1;
	
	//デバッグ
	/*cout << endl;
	rep(i, N) {
		rep(j, N) {
			if (s[i][j] == '#') cout << s[i][j];
			else cout << ".";
		}
		cout << endl;
	}*/
	
	//#の数を累積和する
	rep(i, N) {
		rep(j, N) {
			if (s[i][j] == '#') imosR[i][j + 1]++;
		}
		rep(j, 2 * N + 100) { imosR[i][j + 1] += imosR[i][j]; }
	}
	
	rep(j, N) {
		rep(i, N) {
			if (s[i][j] == '#') imosC[i + 1][j]++;
		}
		rep(i, 2 * N + 100) { imosC[i + 1][j] += imosC[i][j]; }
	}
	
	//2点間の距離dを全探索
	int ans = 0;
	for (int d = 1; d < N; d++) {
		rep(i, N) {
			rep(j, N) {
				if (s[i][j] != '#') continue;
				if (j + d >= N || s[i][j + d] != '#') continue;
				//cout << i << ", " << j << endl;
				//cout << i << ", " << j + d << endl;
				//cout << endl;
				
				ans += imosR[i + d][j + d + 1] - imosR[i + d][j];
				if (i >= d) ans += imosR[i - d][j + d + 1] - imosR[i - d][j];
			}
		}
	}
	
	//全探索その2
	for (int d = 1; d < N; d++) {
		rep(i, N) {
			rep(j, N) {
				if (s[i][j] != '#') continue;
				if (i + d >= N || s[i + d][j] != '#') continue;
				ans += imosC[i + d + 1][j + d] - imosC[i][j + d];
				if (j >= d) ans += imosC[i + d + 1][j - d] - imosC[i][j - d];
			}
		}
	}
	
	//積集合を取り除く1
	for (int d = 1; d < N; d++) {
		rep(i, N) {
			rep(j, N) {
				if (s[i][j] != '#') continue;
				if (j + d >= N || s[i][j + d] != '#') continue;
				//cout << i << ", " << j << endl;a
				//cout << i << ", " << j + d << endl;
				//cout << endl;
				
				ans -= imosR[i + d][j + d + 1] - imosR[i + d][j + d];
				ans -= imosR[i + d][j + 1] - imosR[i + d][j];
				if (i >= d) ans -= imosR[i - d][j + d + 1] - imosR[i - d][j + d];
				if (i >= d) ans -= imosR[i - d][j + 1] - imosR[i - d][j];
			}
		}
	}
	cout << ans << endl;
	return 0;
}