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

using namespace std;

int main(){
    int H, W;
    cin >> H >> W;
    vector<int> sth[600], stw[600];
    for(int i = 0; i < H; i++){
        for(int j  = 0; j < W; j++){
            char s;
            cin >> s;
            if(s == '#') {
                sth[i+j].push_back(i-j+299);
                stw[i-j+299].push_back(i+j);
                //cout << i << ' ' << j << endl;
            }
        }
    }
    long ans = 0;
    for(int i = 0; i < H+W; i++){
        for(auto iter = sth[i].begin(); iter != sth[i].end(); iter++){
            int j = *iter;
            for(auto iter2 = iter; iter2 != sth[i].end(); iter2++){
                int k = *iter2;
                if(j == k) continue;
                //cout << (i+j-299)/2 << ' ' << (i-j+299)/2 << endl;
                if(i+k-j >= 0 && i+k-j < 600) {
                    auto l = lower_bound(sth[i+k-j].begin(), sth[i+k-j].end(), min(j, k));
                    auto r = upper_bound(sth[i+k-j].begin(), sth[i+k-j].end(), max(j, k));
                    ans += r-l;
                }
                if(i+j-k >= 0 && i+j-k < 600) {
                    auto l = lower_bound(sth[i+j-k].begin(), sth[i+j-k].end(), min(j, k));
                    auto r = upper_bound(sth[i+j-k].begin(), sth[i+j-k].end(), max(j, k));
                    ans += r-l;
                }
            }
        }
    }
    for(int i = 0; i <= H+299; i++){
        for(auto iter = stw[i].begin(); iter != stw[i].end(); iter++){
            int j = *iter;
            for(auto iter2 = iter; iter2 != stw[i].end(); iter2++){
                int k = *iter2;
                if(j == k) continue;
                //cout << (i+j-299)/2 << ' ' << (i-j+299)/2 << endl;
                if(i+k-j >= 0 && i+k-j < 600) {
                    auto l = upper_bound(stw[i+k-j].begin(), stw[i+k-j].end(), min(j, k));
                    auto r = lower_bound(stw[i+k-j].begin(), stw[i+k-j].end(), max(j, k));
                    ans += r-l;
                    //cout << *r << endl;
                    //if(r != stw[i+k-j].end() && *r == max(j, k)) ans--;
                }
                if(i+j-k >= 0 && i+j-k < 600) {
                    auto l = upper_bound(stw[i+j-k].begin(), stw[i+j-k].end(), min(j, k));
                    auto r = lower_bound(stw[i+j-k].begin(), stw[i+j-k].end(), max(j, k));
                    ans += r-l;
                    //if(*r == max(j, k)) ans--;
                    //if(r != stw[i+j-k].end() && *r == max(j, k)) ans--;
                }
            }
        }
    }
    cout << ans << endl;
}