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 N = 600;
typedef long long ll;

int n, m;
char st[N + 5][N + 5];
bool vis[N + 5][N + 5];
int cnt[2][N + 5][N + 5];

int calc(int ty, int x, int l, int r) {
    if(x < 0 || x > n + m) return 0;

    return cnt[ty][x][min(r, n+m)] - cnt[ty][x][max(l-1, 0)];
}

int main() {

    scanf("%d%d", &n, &m);
    for(int i = 1; i <= n; ++i) {
        scanf("%s", st[i] + 1);
        for(int j = 1; j <= m; ++j) if(st[i][j] == '#') {
            vis[i + j][i - j + m + 1] = true;
        }
    }

    for(int i = 1; i <= n + m; ++i) {
        for(int j = 1; j <= n + m; ++j) {
            cnt[0][i][j] = cnt[0][i][j - 1] + vis[i][j];
            cnt[1][i][j] = cnt[1][i][j - 1] + vis[j][i];
        }
    }

    ll ans = 0;
    for(int i = 1; i <= n; ++i) {
        for(int j = 1; j <= m; ++j) {
            for(int k = 1; k <= n; ++k) {

                if(i > k && j > k && st[i-k][j] == '#' && st[i][j-k] == '#') {
                    ans += calc(0, i + j + k, i - j - k + m + 1, i + k - j + m + 1);
                }
                if(i > k && j <= m-k && st[i-k][j] == '#' && st[i][j+k] == '#') {
                    ans += calc(1, i + k - j + m + 1, i - k + j, i + j + k);
                }
                if(i <= n-k && j > k && st[i+k][j] == '#' && st[i][j-k] == '#') {
                    ans += calc(1, i - k - j + m + 1, i - k + j, i + j + k);
                }
                if(i <= n-k && j <= m-k && st[i+k][j] == '#' && st[i][j+k] == '#') {
                    ans += calc(0, i - k + j, i - j - k + m + 1, i + k - j + m + 1);
                }

                bool x = (i > k && st[i-k][j] == '#');
                bool y = (j > k && st[i][j-k] == '#');
                bool z = (i <= n-k && st[i+k][j] == '#');
                bool w = (j <= m-k && st[i][j+k] == '#');

                int c = x + y + z + w;

                if(c == 3) ans --;
                if(c == 4) ans -= 4;
            }
        }
    }
    printf("%lld\n", ans);

    return 0;
}