#include <bits/stdc++.h>
using namespace std;
const long long MX = 301;
long long dp[MX][MX][MX];
bool used[MX][MX][MX];
long long a[MX][MX];
long long n;
const long long INF = 1e18;
long long f(long long i1, long long j1, long long i2, long long j2) {
  if (used[i1][j1][i2]) {
    return dp[i1][j1][i2];
  }
  used[i1][j1][i2] = true;
  long long ans = a[i1][j1];
  if (i1 != i2 || j1 != j2) {
    ans += a[i2][j2];
  }
  long long aux = -INF;
  for (long long a = 0; a < 2; a++) {
    for (long long b = 0; b < 2; b++) {
      long long i1New = i1;
      long long j1New = j1;
      long long i2New = i2;
      long long j2New = j2;
      if (a == 0) {
        i1New++;
      } else {
        j1New++;
      }
      if (b == 0) {
        i2New++;
      } else {
        j2New++;
      }
      if (i1New < n && j1New < n && i2New < n && j2New < n) {
        aux = max(aux, f(i1New, j1New, i2New, j2New));
      }
    }
  }
  if (aux != -INF) {
    ans += aux;
  }
  return dp[i1][j1][i2] = ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < n; j++) cin >> a[i][j];
  cout << f(0, 0, 0, 0) << endl;
  return 0;
}
