#include<cstdio>
char s[305][305];
int sum0[605][605], sum1[605][605];

int getSum0(int i,int l,int r,int n,int m){
    if(i<=0 || i>=n+m) return 0;
    else if(l>r) return 0; 
    else return sum0[i][r]-sum0[i][l-1];
}

int getSum1(int i,int l,int r,int n,int m){
    if(i<=1 || i>=n+m+1) return 0;
    else if(l>r) return 0;
    else return sum1[i][r]-sum1[i][l-1];
}

int main(){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i = 1; i <= n; i++){
        scanf("%s",s[i]+1);
        for(int j = 1; j <= m; j++){
            if(s[i][j]=='#'){
                sum0[i-j+m][i+j] = 1;
                sum1[i+j][i-j+m] = 1;
            }
        }
    }
    for(int i = 1; i <= n+m-1; i++){
        sum0[i][0] = 0;
        for(int j = 1; j <= n+m; j++) sum0[i][j] += sum0[i][j-1];
    }
    for(int i = 2; i <= n+m; i++){
        sum1[i][0] = 0;
        for(int j = 1; j <= n+m-1; j++) sum1[i][j] += sum1[i][j-1];
    }
    long long ans = 0;
    for(int i = 1; i <= n+m-1; i++){
        for(int j = 2; j <=n+m; j++){
            if(sum0[i][j]==sum0[i][j-1]) continue;
            for(int k = 2; k < j; k++){
                if(sum0[i][k]==sum0[i][k-1]) continue;
                //printf("i = %d, j = %d, k = %d\n",i,j,k);
                int diff = j-k;
                //printf("diff = %d\n",diff);
                long long add = getSum0(i+diff,k,j,n,m)+getSum0(i-diff,k,j,n,m);
                ans += add;
            }
        }
    }
    for(int i = 2; i <= n+m; i++){
        for(int j = 1; j <=n+m-1; j++){
            if(sum1[i][j]==sum1[i][j-1]) continue;
            for(int k = 1; k < j; k++){
                if(sum1[i][k]==sum1[i][k-1]) continue;
                int diff = j-k;
                long long add = getSum1(i+diff,k+1,j-1,n,m)+getSum1(i-diff,k+1,j-1,n,m);
                ans += add;
            }
        }
    }
    printf("%lld\n",ans);
    return 0;
}
