#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const long long MAX = 2005;
int k;
int dp[605][305][305];
int arr[305][305];
bool ok(int dist, int a, int c) {
  int b = dist - a;
  int d = dist - c;
  return ((0 <= a) && (0 <= b) && (0 <= c) && (0 <= d) && (a < k) && (b < k) &&
          (c < k) && (d < k));
}
int add(int dist, int a, int c) {
  int ans = 0;
  int b = dist - a;
  int d = dist - c;
  if (a == c && b == d) {
    ans += arr[a][b];
  } else {
    ans += arr[a][b] + arr[c][d];
  }
  return ans;
}
int main() {
  cin >> k;
  for (int i = 0; i < k; i++) {
    for (int j = 0; j < k; j++) {
      scanf("%d", &arr[i][j]);
    }
  }
  memset(dp, -10000, sizeof dp);
  dp[0][0][0] = arr[0][0];
  for (int d = 0; d < 2 * k - 1; d++) {
    for (int a = 0; a < d + 1; a++) {
      for (int b = 0; b < d + 1; b++) {
        int x = d - a;
        int y = d - b;
        if (ok(d + 1, a, b + 1)) {
          dp[d + 1][a][b + 1] =
              max(dp[d + 1][a][b + 1], dp[d][a][b] + add(d + 1, a, b + 1));
        }
        if (ok(d + 1, a + 1, b)) {
          dp[d + 1][a + 1][b] =
              max(dp[d + 1][a + 1][b], dp[d][a][b] + add(d + 1, a + 1, b));
        }
        if (ok(d + 1, a, b)) {
          dp[d + 1][a][b] =
              max(dp[d + 1][a][b], dp[d][a][b] + add(d + 1, a, b));
        }
        if (ok(d + 1, a + 1, b + 1)) {
          dp[d + 1][a + 1][b + 1] = max(dp[d + 1][a + 1][b + 1],
                                        dp[d][a][b] + add(d + 1, a + 1, b + 1));
        }
      }
    }
  }
  int d = 2 * k - 2;
  cout << dp[d][d / 2][d / 2] << endl;
}
