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
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstring>
#include <string>
#include <math.h>
using namespace std;
typedef long long ll;
typedef double D;
typedef pair<ll,ll> P;
#define M 1000000007
#define F first
#define S second
#define PB push_back
#define INF 100000000000000000
int h,w;
ll ans;
vector<int>r[1005],c[1005];
int main(void){
    cin>>h>>w;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            char s;
            cin>>s;
            if(s=='#'){
                r[i-j+300].PB(i+j);
                c[i+j].PB(i-j+300);
            }
        }
    }
    for(int i=0;i<600;i++){
        if(r[i].size()>0)sort(r[i].begin(),r[i].end());
        if(c[i].size()>0)sort(c[i].begin(),c[i].end());
    }
    for(int i=0;i<600;i++){
        for(int j=0;j<c[i].size();j++){
            for(int k=j+1;k<c[i].size();k++){
                int a=c[i][j],b=c[i][k],d=b-a;
                if(i-d>=0&&c[i-d].size()>0){
                    ll x=lower_bound(c[i-d].begin(),c[i-d].end(),a)-c[i-d].begin(),y=upper_bound(c[i-d].begin(),c[i-d].end(),b)-c[i-d].begin();
                    ans+=(y-x);
                    if(x<c[i-d].size()&&c[i-d][x]==a)ans--;
                    if(y-1<c[i-d].size()&&c[i-d][y-1]==b)ans--;
                }
                if(i+d<600&&c[i+d].size()>0){
                    ll x=lower_bound(c[i+d].begin(),c[i+d].end(),a)-c[i+d].begin(),y=upper_bound(c[i+d].begin(),c[i+d].end(),b)-c[i+d].begin();
                    ans+=(y-x);
                    if(x<c[i+d].size()&&c[i+d][x]==a)ans--;
                    if(y-1<c[i+d].size()&&c[i+d][y-1]==b)ans--;
                }
            }
        }
    }
    for(int i=0;i<600;i++){
        for(int j=0;j<r[i].size();j++){
            for(int k=j+1;k<r[i].size();k++){
                int a=r[i][j],b=r[i][k],d=b-a;
                if(i-d>=0&&r[i-d].size()>0){
                    ll x=lower_bound(r[i-d].begin(),r[i-d].end(),a)-r[i-d].begin(),y=upper_bound(r[i-d].begin(),r[i-d].end(),b)-r[i-d].begin();
                    ans+=(y-x);
                }
                if(i+d<600&&r[i+d].size()>0){
                    ll x=lower_bound(r[i+d].begin(),r[i+d].end(),a)-r[i+d].begin(),y=upper_bound(r[i+d].begin(),r[i+d].end(),b)-r[i+d].begin();
                    ans+=(y-x);
                }
            }
        }
    }
    cout<<ans<<endl;
}
