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;
typedef pair<int, int> i_i;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;

int main() {
    //cout.precision(10);
    int H, W;
    cin >> H >> W;
    string S[320];
    for(int i = 1; i <= H; i++){
        cin >> S[i];
        S[i] = "a" + S[i];
    }
    vector<int> points[605];
    vector<int> points2[605];
    for(int h = 1; h <= H; h++){
        for(int w = 1; w <= W; w++){
            if(S[h][w] == '#'){
                points[h + w].push_back(h - w);
                points2[h - w + 300].push_back(h + w);
            }
        }
    }
    for(int i = 0; i <= 600; i++){
        sort(points[i].begin(), points[i].end());
        sort(points2[i].begin(), points2[i].end());
    }
    int ans = 0;
    for(int X = 0; X <= 600; X++){
        int number = points[X].size();
        for(int j = 0; j < number; j++){
            for(int k = j + 1; k < number; k++){
                int dY = points[X][k] - points[X][j];
                if(X - dY >= 0){
                    ans += distance(lower_bound(points[X - dY].begin(), points[X - dY].end(), points[X][j]), upper_bound(points[X - dY].begin(), points[X - dY].end(), points[X][k]));
                }
                if(X + dY <= 600){
                    ans += distance(lower_bound(points[X + dY].begin(), points[X + dY].end(), points[X][j]), upper_bound(points[X + dY].begin(), points[X + dY].end(), points[X][k]));
                }
            }
        }
    }
    for(int X = 0; X <= 600; X++){
        int number = points2[X].size();
        for(int j = 0; j < number; j++){
            for(int k = j + 1; k < number; k++){
                int dY = points2[X][k] - points2[X][j];
                if(X - dY >= 0){
                    ans += distance(upper_bound(points2[X - dY].begin(), points2[X - dY].end(), points2[X][j]), lower_bound(points2[X - dY].begin(), points2[X - dY].end(), points2[X][k]));
                }
                if(X + dY <= 600){
                    ans += distance(upper_bound(points2[X + dY].begin(), points2[X + dY].end(), points2[X][j]), lower_bound(points2[X + dY].begin(), points2[X + dY].end(), points2[X][k]));
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}