Matrix of given integers


a1,1 a1,2 ... a1, n
a2,1 a2,2 ... a2, n
::
an, 1 an, 2 ... an, n


Then, create a program that outputs the maximum value of the sum of one or more consecutive terms (submatrix) in the vertical and horizontal directions and ends.



Input

The input data is given in the following format.


n
a1,1 a1,2 ... a1, n
a2,1 a2,2 ... a2, n
::
an, 1 an, 2 ... an, n


n is 1 or more and 100 or less, and ai, j is -10000 or more and 10000 or less.

Output

Print the maximum value on one line.

Examples

Input

3
1 -2 3
-4 5 6
7 8 -9


Output

16


Input

4
1 3 -9 2
2 7 -1 5
-8 3 2 -1
5 0 -3 1


Output

15
import java.util.*;
import java.io.*;

public class Main {
	public void solve() throws IOException {
		int n = nextInt();
		int[][] mat = new int[n][n];
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				mat[i][j] = nextInt();
			}
		}
		int[][][] sum = new int[n][n][n];
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				sum[i][j][j] = mat[i][j];
				for(int k = j+1; k < n; k++){
					sum[i][j][k] = sum[i][j][k-1] + mat[i][k];
				}
			}
		}
	/*	for(int[][] x : sum){
			for(int[] y : x){
				for(int z : y){
					writer.print(z + " ");
				}
				writer.println();
			}
			writer.println();
		}*/
		long ans = Integer.MIN_VALUE;
		for(int i = 0; i < n; i++){
			for(int j = 0; j < n; j++){
				for(int k = j; k < n; k++){
					long tmp = 0;
					for(int l = i; l < n; l++){
						tmp += sum[l][j][k];
						ans = Math.max(ans, tmp);
		//				writer.println("sum[" + l + "][" + j + "][" + k + "] = " + sum[l][j][k]);
		//				writer.println(i + ", " + j + ", " + k + ", " + l + ", " + tmp);
					}
				}
			}
		}
		writer.println(ans);
	}

	public static void main(String[] args) throws IOException {
		new Main().run();
	}

	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter writer;

	public void run() throws IOException {
		try {
			reader = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = null;
			writer = new PrintWriter(System.out);
			solve();
			reader.close();
			writer.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}
}