#include<iostream>
using namespace std;
char St[305];
int n,m,i,j,S[605][605],A[605][605],k,rez,sum;

int nr(int i1, int j1, int i2, int j2)
{
    i1--;
    j1--;
    i1=max(i1,0);
    i2=max(i2,0);
    j2=max(j2,0);
    j1=max(j1,0);
    i1=min(i1,n);
    i2=min(i2,n);
    j2=min(j2,n);
    j1=min(j1,n);
    if(i1>i2 || j1>j2)
        return 0;
    return (S[i2][j2]-S[i1][j2]-S[i2][j1]+S[i1][j1]);
}

int main()
{
    ios::sync_with_stdio(false);
    cin>>n>>m;
    for(i=1; i<=n; i++)
    {
        cin>>St;
        for(j=1; j<=m; j++)
            A[i-j+m][i+j]=(St[j-1]=='#');
    }
    n+=m;
    for(i=0; i<=n; i++)
        for(j=0; j<=n; j++)
        {
            sum=A[i][j];
            if(i>=1)
                sum+=S[i-1][j];
            if(j>=1)
                sum+=S[i][j-1];
            if(i>=1 && j>=1)
                sum-=S[i-1][j-1];
            S[i][j]=sum;
        }
    for(i=0; i<=n; i++)
        for(j=2; j<=n; j++)
            if(A[i][j])
            {
                for(k=j+2; k<=n; k+=2)
                    if(A[i][k])
                    {
                        rez=rez+nr(i+(k-j),j,i+(k-j),k);
                        rez=rez+nr(i-(k-j),j,i-(k-j),k);
                    }
                for(k=i+2; k<=n; k+=2)
                    if(A[k][j])
                    {
                        rez=rez+nr(i+1,j+(k-i),k-1,j+(k-i));
                        rez=rez+nr(i+1,j-(k-i),k-1,j-(k-i));
                    }
            }
    cout<<rez<<"\n";
    return 0;
}
