#include <cstdio>
#include <algorithm>

using namespace std;

char s[300][301];
int sum1[600][301];
int sum2[600][301];

int get1(int p, int l, int r) {
    l = max(l, 0);
    r = min(r + 1, 300);
    
    if (p < 0 || p >= 600) return 0;
    
    return sum1[p][r] - sum1[p][l];
}

int get2(int p, int l, int r) {
    p += 300;
    l = max(l, 0);
    r = min(r + 1, 300);
    
    if (p < 0 || p >= 600) return 0;
    
    return sum2[p][r] - sum2[p][l];
}

int main() {
    int h, w, i, j, k;
    long long ans = 0;
    
    scanf("%d %d", &h, &w);
    
    for (i = 0; i < h; i++) scanf("%s", s[i]);
    
    for (i = 0; i < h; i++) {
        for (j = 0; j < w; j++) {
            if (s[i][j] == '#') {
                sum1[i + j][i + 1]++;
                sum2[i - j + 300][i + 1]++;
            }
        }
    }
    
    for (i = 0; i < 600; i++) {
        for (j = 1; j <= 300; j++) {
            sum1[i][j] += sum1[i][j - 1];
            sum2[i][j] += sum2[i][j - 1];
        }
    }
    
    for (i = 0; i < h; i++) {
        for (j = 0; j < w; j++) {
            if (s[i][j] == '.') continue;
            
            for (k = 1; ; k++) {
                int x = i + k;
                int y = j - k;
                
                if (x >= h || y < 0) break;
                if (s[x][y] == '.') continue;
                
                ans += get1(i + j - k * 2, i - k, i);
                ans += get1(i + j + k * 2, x, x + k);
            }
            
            for (k = 1; ; k++) {
                int x = i + k;
                int y = j + k;
                
                if (x >= h || y >= w) break;
                if (s[x][y] == '.') continue;
                
                ans += get2(i - j - k * 2, i - k, i);
                ans += get2(i - j + k * 2, x, x + k);
            }
            
            for (k = 1; i + k * 2 < h; k++) {
                if (s[i + k * 2][j] == '.') continue;
                
                if (j - k >= 0 && s[i + k][j - k] == '#') ans--;
                if (j + k < w && s[i + k][j + k] == '#') ans--;
            }
            
            for (k = 1; j + k * 2 < w; k++) {
                if (s[i][j + k * 2] == '.') continue;
                
                if (i - k >= 0 && s[i - k][j + k] == '#') ans--;
                if (i + k < h && s[i + k][j + k] == '#') ans--;
            }
        }
    }
    
    printf("%lld\n", ans);
    
    return 0;
}
