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;
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w

#define int long long
//typedef    long long          ll;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      P;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000007;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

vector<int> xs[620],ys[620];

signed main(){
	int h,w,ans = 0;
	string field[310];
	cin >> h >> w;
	for(int i = 0;i < h;i++){
		cin >> field[i];
		for(int j = 0;j < w;j++){
			if(field[i][j] == '#'){
				xs[i + j].pb(i - j + 300);
				ys[i - j + 300].pb(i + j);
			}
		}
	}
	for(int i = 0;i < 620;i++) sort(all(xs[i]));
	for(int i = 0;i < 620;i++) sort(all(ys[i]));
	for(int i = 0;i < 620;i++){
		for(int j = 0;j < xs[i].size();j++){
			for(int k = j + 1;k < xs[i].size();k++){
				if(i + xs[i][k] - xs[i][j] < 620) ans += upper_bound(all(xs[i + xs[i][k] - xs[i][j]]),xs[i][k]) - lower_bound(all(xs[i + xs[i][k] - xs[i][j]]),xs[i][j]);
				if(i - xs[i][k] + xs[i][j] >= 0) ans += upper_bound(all(xs[i - xs[i][k] + xs[i][j]]),xs[i][k]) - lower_bound(all(xs[i - xs[i][k] + xs[i][j]]),xs[i][j]);
			}
		}
	}
	for(int i = 0;i < 620;i++){
		for(int j = 0;j < ys[i].size();j++){
			for(int k = j + 1;k < ys[i].size();k++){
				if(ys[i][k] - ys[i][j] >= 2){
					if(i + ys[i][k] - ys[i][j] < 620) ans += upper_bound(all(ys[i + ys[i][k] - ys[i][j]]),ys[i][k] - 1) - lower_bound(all(ys[i + ys[i][k] - ys[i][j]]),ys[i][j] + 1);
					if(i - ys[i][k] + ys[i][j] >= 0) ans += upper_bound(all(ys[i - ys[i][k] + ys[i][j]]),ys[i][k] - 1) - lower_bound(all(ys[i - ys[i][k] + ys[i][j]]),ys[i][j] + 1);
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}