Farmer John wants to take a photo of his grazing cows and hang it on the wall. The pasture is represented by a grid of size n \times n cells (like a chessboard of size n \times n). Farmer John wants to place cows on the pasture according to the following rules:
No two cows can be in the same cell.
Each 2 \times 2 subgrid (there are (n - 1) \times (n - 1) such subgrids in total) must contain exactly cows.
For example, this placement follows the rules:
CCC
...
CCCBut this placement does not:
C.C
.C.
C..because the 2 \times 2 region in the bottom right corner contains only one cow.
There are no other restrictions. You can assume that Farmer John has an infinite number of cows.
Some cells are more preferable to Farmer John than others. Specifically, he believes that if a cow is placed in cell , the beauty of the photo increases by a_{ij} (0 \le a_{ij} \le 1000) units.
Determine the maximum possible beauty of a valid cow placement.
The first line contains the number (2 \le n \le 1000). Each of the next lines contains integers. The -th number in the -th line from the top is the value a_{ij}.
Output a single integer - the maximum possible beauty of the resulting photo.
Example 1
In this example, the maximum beauty can be achieved with the following placement:
CC..
..CC
CC..
..CCThe beauty of this placement is 3 + 3 + 3 + 1 + 3 + 3 + 3 + 3 = 22.