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;

const int kN = 300 + 5;
char s[kN][kN], t[kN][kN];

int main() {
    int h, w; scanf("%d%d", &h, &w);
    for (int i = 0; i < h; ++i) scanf("%s", s[i]);
    long long ans = 0;
    for (int i = 0; i < h; ++i) {
        for (int j = 0; j < w; ++j) {
            if (s[i][j] == '.') continue;
            for (int d = 2; ; d += 2) {
                if (i + d >= h) break;
                if (s[i + d][j] == '.') continue;
                if (j + d / 2 < w) ans += s[i + d / 2][j + d / 2] == '#';
                if (j - d / 2 >= 0) ans += s[i + d / 2][j - d / 2] == '#';
            }
            for (int d = 2; ; d += 2) {
                if (j + d >= w) break;
                if (s[i][j + d] == '.') continue;
                if (i + d / 2 < h) ans += s[i + d / 2][j + d / 2] == '#';
                if (i - d / 2 >= 0) ans += s[i - d / 2][j + d / 2] == '#';
            }
        }
    }
    for (int rot = 0; rot < 4; ++rot) {
        vector<vector<int>> cd(h + w, vector<int>(h));
        vector<pair<int, int>> v;
        for (int i = 0; i < h; ++i) {
            for (int j = 0; j < w; ++j) {
                if (s[i][j] == '.') continue;
                cd[i + j][i]++;
            }
        }
        for (int i = 0; i < h + w; ++i) {
            for (int j = 1; j < h; ++j) cd[i][j] += cd[i][j - 1];
        }
        for (int i = 0; i < h; ++i) {
            for (int j = 0; j < w; ++j) {
                for (int d = 1; i + d < h && j + d < w; ++d) {
                    if (s[i + d][j] == '.' || s[i][j + d] == '.') continue;
                    int sum = i + j + 3 * d;
                    if (sum < h + w) {
                        int l = i + d, r = sum - j - d;
                        int add = cd[sum][min(h - 1, r - 1)] - cd[sum][l];
                        ans += add;
                    }
                }
            }
        }
        for (int i = 0; i < h; ++i) {
            for (int j = 0; j < w; ++j) t[w - 1 - j][i] = s[i][j];
        }
        swap(h, w);
        for (int i = 0; i < h; ++i) {
            for (int j = 0; j < w; ++j) s[i][j] = t[i][j];
        }
    }
    printf("%lld\n", ans);
    return 0;
}