#include <bits/stdc++.h>
using namespace std;
int n;
int arr[300][300];
int DP[300][300][300][2];
int solve(int row, int a, int b, int c) {
  if (DP[row][a][b][c] != -1000000000) return DP[row][a][b][c];
  int res = -1000000000;
  if (row == 0 && a == 0 && b == 0) res = max(res, arr[0][0]);
  if (row != 0) {
    int temp = arr[row][a];
    if (a != b) temp += arr[row][b];
    res = max(res, solve(row - 1, a, b, 1) + temp);
  }
  if (c == 1) res = max(res, solve(row, a, b, 0));
  if (a == b) {
    if (a != 0) res = max(res, solve(row, a - 1, b, 1));
  } else {
    if (b != 0 && c) res = max(res, solve(row, a, b - 1, 1) + arr[row][b]);
    if (a != 0 && !c) {
      res = max(res, solve(row, a - 1, b, 0) + arr[row][a]);
    }
  }
  DP[row][a][b][c] = res;
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      scanf("%d", &arr[i][j]);
      for (int k = 0; k < n; k++) {
        for (int p = 0; p < 2; p++) {
          DP[i][j][k][p] = -1000000000;
        }
      }
    }
  }
  printf("%d", solve(n - 1, n - 1, n - 1, 1));
  return 0;
}
