There is a grid of size $N \times M$. The cell at row $i$, column $j$ contains a non-negative integer $a_{ij}$. ($1 \le i \le N$; $1 \le j \le M$)
Each turn, Minji performs the following actions.
- Minji selects two horizontally or vertically adjacent grid cells. At least one of the two cells must contain a positive integer.
- Minji decreases the number in each selected cell by $1$. However, if some cell contains $0$, she does not decrease that number.
The game ends when every cell contains $0$. Minji wishes to play this game as long as she can. Find out the maximum number of turns the game can last when Minji does her best.
Input
The first line of input contains two space-separated positive integers $N$ and $M$. ($2 \le N, M \le 1\,000$)
Then, $N$ lines follow. The $i$-th of them contains $M$ space-separated integers $a_{i1}, a_{i2}, \cdots, a_{iM}$. ($0 \le a_{ij} \le 10^9$)
Output
In the first line, print the maximum number of turns the game can last.
Examples
Input 1
2 2 0 1 0 0
Output 1
1
Input 2
2 2 1 0 1 1
Output 2
3