#include <bits/stdc++.h>
using namespace std;
int arr[301][301];
int dp[602][301][301];
int n;
int f(int idx, int i1, int i2) {
  if (i1 > n || i2 > n) return -1e9;
  int j1 = idx - i1;
  int j2 = idx - i2;
  if (j1 > n || j2 > n) return -1e9;
  if (idx == 2 * n) return arr[i1][j1];
  int &ans = dp[idx][i1][i2];
  if (ans != -(1e9 + 1)) return ans;
  int best = -1e9;
  if (i1 == i2) {
    ans = arr[i1][j1];
  } else {
    ans = arr[i1][j1] + arr[i2][j2];
  }
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < 2; j++) {
      best = max(best, f(idx + 1, i1 + i, i2 + j));
    }
  }
  ans += best;
  return ans;
}
int main(int argc, char const *argv[]) {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> arr[i][j];
    }
  }
  for (int k = 1; k <= 2 * n; k++) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        dp[k][i][j] = -(1e9 + 1);
      }
    }
  }
  int ans = f(2, 1, 1);
  cout << ans;
  return 0;
}
