You are given a N x N square matrix of integers where each cell represents the amount of gold in it. You need to travel from the top left cell to the bottom right cell, and back, maximizing the amount of gold you collect as you pass by the cell following some constraints given below 

You cannot use squares on the leading diagonal of the matrix (Apart from the top left and the bottom right cells.)

When travelling to the bottom right corner from the top left corner, you may only move rightwards or downwards, but never cross the main diagonal.

Similarly, while travelling back to the top left corner from the bottom right corner, you may move only leftwards or upwards, but never cross the main diagonal.

Input / Output

The first line contains an integer N denoting the number of rows and columns in the grid.

Then follows N lines where each line contains N integers, where each line denotes the row and each number in each line denotes the column.

Output the maximum gold you can collect, from top left cell to the bottom right cell and back, under the given constraints.

SAMPLE INPUT
3
4 10 6
1 1 5
-5 6 8

SAMPLE OUTPUT
39

Explanation

There is exactly one path available. The solution is 4 + 10 + 6 + 5 + 8 + 6 -5 + 1 + 4=39.
def main():
     n = input()
     l = []
     m = [] 
     for i in range(n):
         str = raw_input()
         spl = str.split()
         l.append([])
         m.append([])
         for j in range(n):
             l[i].append(int(spl[j]))
             m[i].append(-999999999)
     q = []
     s = 0 
     q.append((0,1))
     m[0][0] = l[0][0]
     for i in q:
               x, y = i[0] , i[1]
               val1 , val2 , val3 =  -99999999, -9999999, -999999999 
               if( x-1 >= 0):
                    val1 =  m[x-1][y]
               if( y-1 != x or x == 0):
                    val2 = m[x][y-1]
               m[x][y] = max( val1 , val2)+l[x][y]
               if( x+1 < n and x+1 != y):
                    q.append( (x+1,y))
               if( y + 1 < n):
                    q.append( (x , y+1))
     m[n-1][n-1] = max(m[n-2][n-1], m[n-1][n-2]) + l[n-1][n-1]
     q = []
     """
     q = []
     for i in range(3):
            for j in range(i):
                  m[i][j] , m[j][i] = m[j][i] , m[i][j]
                  l[i][j] , l[j][i] = l[j][i] , l[i][j]
     q = []
     s = 0 
     q.append((0,1))
     m[0][0] = l[0][0]
     for i in q:
               x, y = i[0] , i[1]
               val1 , val2 , val3 =  -99999999, -9999999, -999999999 
               if( x-1 >= 0):
                    val1 =  m[x-1][y]
               if( y-1 != x or x == 0):
                    val2 = m[x][y-1]
               m[x][y] = max( val1 , val2)+l[x][y]
               if( x+1 < n and x+1 != y):
                    q.append( (x+1,y))
               if( y + 1 < n):
                    q.append( (x , y+1))
     m[n-1][n-1] = max(m[n-2][n-1], m[n-1][n-2]) + l[n-1][n-1]
     print(max(m[n-2][n-1], m[n-1][n-2]) + l[n-1][n-1])
     for i in range(3):
            for j in range(i):
                  m[i][j] , m[j][i] = m[j][i] , m[i][j]
                  l[i][j] , l[j][i] = l[j][i] , l[i][j]
     print(m)
     """
     p = []
     p.append( (n-1 , n-2))
     for i in p:
               x , y = i[0] , i[1]
               val1 , val2 , val3 =  -99999999, -9999999, -999999999
               if( x+1 < n and (x+1 != y)):
                     val1 = m[x+1][y]
               if( y+1 <n or y+1 != x or y+1 == n-1):
                     val2 = m[x][y+1]
               m[x][y] = max( val1 , val2)+ l[x][y]
               if( x-1 >= 0 and x-1 != y):
                     p.append( (x-1,y))
               if( y-1 >= 0  and y-1 != x):
                     p.append( (x , y-1))
     print( max(m[1][0] , m[0][1])+l[0][0])


if __name__ == "__main__":main()