Given a grid of height h and width w, you are asked to calculate the maximum sum one might obtain by moving from top to bottom, where on each step it’s only allowed to move to the below adjacent 3 cells. In other words, being at position (r, c), you can move to positions: (r + 1, c - 1), (r + 1, c), and (r + 1, c + 1). That’s why we call it a falling sum - as we fall from the top to the very bottom of the grid. Find the maximum sum of the path.

ㅤ

o

ㅤ

ㅤ

↙️

⬇️

↘️

ㅤ

ㅤ

ㅤ

ㅤ

ㅤ

ㅤ

ㅤ

ㅤ

ㅤ

Input

The first line of the input contains two integers h and w (1 ≤ h, w ≤ 100).

The next h lines contain w numbers (-100 ≤ ≤ 100) representing the values of the grid at row r and column c.

Output

The program should print the maximum possible sum obtained among all the possible falling paths.