You are given an n × m grid, some of its nodes are black, the others are white. Moreover, it's not an ordinary grid — each unit square of the grid has painted diagonals.

The figure below is an example of such grid of size 3 × 5. Four nodes of this grid are black, the other 11 nodes are white.

<image>

Your task is to count the number of such triangles on the given grid that:

  * the corners match the white nodes, and the area is positive; 
  * all sides go along the grid lines (horizontal, vertical or diagonal); 
  * no side contains black nodes. 

Input

The first line contains two integers n and m (2 ≤ n, m ≤ 400). Each of the following n lines contain m characters (zeros and ones) — the description of the grid. If the j-th character in the i-th line equals zero, then the node on the i-th horizontal line and on the j-th vertical line is painted white. Otherwise, the node is painted black.

The horizontal lines are numbered starting from one from top to bottom, the vertical lines are numbered starting from one from left to right. 

Output

Print a single integer — the number of required triangles.

Examples

Input

3 5
10000
10010
00001


Output

20


Input

2 2
00
00


Output

4


Input

2 2
11
11


Output

0

Note

The figure below shows red and blue triangles. They are the examples of the required triangles in the first sample. One of the invalid triangles is painted green. It is invalid because not all sides go along the grid lines.

<image>
#include <bits/stdc++.h>
using namespace std;
int mat[405][405];
int n, m;
string s;
int hangr[405][405], hangl[405][405];
int lieu[405][405];
void Init() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    for (int j = 0; j < m; j++) mat[i][j + 1] = s[j] - '0';
  }
  for (int i = 1; i <= n; i++) {
    int last = 0;
    for (int j = 1; j <= m; j++) {
      if (mat[i][j]) last = j;
      hangl[i][j] = last;
    }
    last = m + 1;
    for (int j = m; j >= 1; j--) {
      if (mat[i][j]) last = j;
      hangr[i][j] = last;
    }
  }
  for (int j = 1; j <= m; j++) {
    int last = 0;
    for (int i = 1; i <= n; i++) {
      if (mat[i][j]) last = i;
      lieu[i][j] = last;
    }
  }
}
void solve() {
  int ans = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (mat[i][j]) continue;
      for (int l = 1; i + l <= n && j + l <= m; l++) {
        if (mat[i + l][j + l]) break;
        if (hangl[i + l][j + l] < j && lieu[i + l][j] < i) ans++;
      }
      for (int l = 1; i + l <= n && j - l > 0; l++) {
        if (mat[i + l][j - l]) break;
        if (hangr[i + l][j - l] > j && lieu[i + l][j] < i) ans++;
      }
      for (int l = 1; i + l <= n && j - l > 0; l++) {
        if (mat[i + l][j - l]) break;
        if (hangr[i][j - l] > j && lieu[i + l][j - l] < i) ans++;
      }
      for (int l = 1; i + l <= n && j + l <= m; l++) {
        if (mat[i + l][j + l]) break;
        if (hangl[i][j + l] < j && lieu[i + l][j + l] < i) ans++;
      }
      for (int l = 1; j - l > 0 && j + l <= m && i - l > 0; l++) {
        if (mat[i - l][j - l] || mat[i - l][j + l]) break;
        if (hangl[i - l][j + l] < j - l) ans++;
      }
      for (int l = 1; j - l > 0 && j + l <= m && i + l <= n; l++) {
        if (mat[i + l][j - l] || mat[i + l][j + l]) break;
        if (hangl[i + l][j + l] < j - l) ans++;
      }
      for (int l = 1; i - l > 0 && i + l <= n && j + l <= m; l++) {
        if (mat[i - l][j + l] || mat[i + l][j + l]) break;
        if (lieu[i + l][j + l] < i - l) ans++;
      }
      for (int l = 1; i - l > 0 && i + l <= n && j - l > 0; l++) {
        if (mat[i - l][j - l] || mat[i + l][j - l]) break;
        if (lieu[i + l][j - l] < i - l) ans++;
      }
    }
  cout << ans;
}
int main() {
  Init();
  solve();
  return 0;
}
