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:
/*
[tenka1-2018] E - Equilateral
*/

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;

const int N = 300;

int H, W;
bool s[N][N];
int cnt[2][3 * N + 1][3 * N + 1];

bool is_in(int i, int j) { return 0 <= i && i < H && 0 <= j && j < W; }

ll solve() {
    memset(cnt, 0, sizeof(cnt));
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            if (!s[i][j]) {
                continue;
            }
            for (int d = 1; is_in(i + d, j + d); d++) {
                if (!s[i + d][j + d]) {
                    continue;
                }
                cnt[0][i + d + 1 + N][j - d + 1 + N]++;
                cnt[0][i + 2 * d + N][j + N]--;
                cnt[0][i - d + 1 + N][j + d + 1 + N]++;
                cnt[0][i + N][j + 2 * d + N]--;
            }
            for (int d = 1; is_in(i - d, j + d); d++) {
                if (!s[i - d][j + d]) {
                    continue;
                }
                cnt[1][i + d + N][j + d + N]++;
                cnt[1][i - 1 + N][j + 2 * d + 1 + N]--;
                cnt[1][i - d + N][j - d + N]++;
                cnt[1][i - 2 * d - 1 + N][j + 1 + N]--;
            }
        }
    }

    for (int i = 1; i < 3 * N; i++) {
        for (int j = 1; j < 3 * N; j++) {
            cnt[0][i][j] += cnt[0][i - 1][j - 1];
        }
    }
    for (int i = 3 * N - 2; i >= 0; i--) {
        for (int j = 1; j < 3 * N; j++) {
            cnt[1][i][j] += cnt[1][i + 1][j - 1];
        }
    }

    ll ans = 0;
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            if (s[i][j]) {
                ans += cnt[0][i + N][j + N] + cnt[1][i + N][j + N];
            }
        }
    }

    return ans;
}

int main() {
    cin >> H >> W;
    for (int i = 0; i < H; i++) {
        string row;
        cin >> row;
        for (int j = 0; j < W; j++) {
            s[i][j] = (row[j] == '#');
        }
    }

    cout << solve() << endl;

    return 0;
}