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 <algorithm>
#include <iostream>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)

int main() {
    const int M = 300;
    int h, w; cin >> h >> w;
    vector<string> s(h); for (auto &si: s) cin >> si;
    vector<vector<bool>> b(M * 2, vector<bool>(M * 2));
    for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) {
        if (s[i][j] == '#') b[i + j][i - j + M] = true;
    }
    auto calc = [&](bool rev) {
        if (rev) rep(i, M * 2) rep(j, i) swap(b[i][j], b[j][i]);
        vector<vector<int>> acc(M * 2, vector<int>(M * 2 + 1));
        rep(i, M * 2) rep(j, M * 2) acc[i][j + 1] = acc[i][j] + b[i][j];
        long long ans = 0;
        rep(i, M * 2) rep(j, M * 2) if (b[i][j]) {
            for (int k = j + 1; k < M * 2; k++) if (b[i][k]) {
                int d = k - j, lf = rev ? j + 1 : j, rg = rev ? k : k + 1;
                if (0 <= i - d)    ans += acc[i - d][rg] - acc[i - d][lf];
                if (i + d < M * 2) ans += acc[i + d][rg] - acc[i + d][lf];
            }
        }
        return ans;
    };
    cout << calc(false) + calc(true) << endl;
    return 0;
}