public static void main(String[] args) throws IOException {
		StringBuilder out = new StringBuilder();
		Scanner in = new Scanner(System.in);
		while (in.hasNext()) {
			int size = in.nextInt();
			m = new long[size][size];
			long max = Long.MIN_VALUE;
			for (int i = 0; i < m.length; i++)
				for (int j = 0; j < m.length; j++)
					m[i][j] = in.nextLong();
			max = getMaxRectangleSum();
			out.append(max + "\n");
		}
		System.out.print(out);
	}