Turtle#4018

Turtle

2 seconds
128 megabytes
Very easy (≈850)

In the top-left corner of a rectangular table of size n \times m, there is a turtle. Each cell of the table contains some amount of acid. The turtle can move only right or down; its journey ends in the bottom-right cell of the table.

Input

The first line contains two natural numbers and (1 \le n, m \le 1000) — the dimensions of the table. Each of the next lines contains integers, separated by spaces — the description of the table, where each number denotes the amount of acid in the corresponding cell (in milliliters).

Output

Output the minimum possible damage the turtle can receive.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading