#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const int mod = 1e9 + 7;
int dp[602][302][302], n, a[303][303];
int solve(int dg, int i1, int i2) {
  if (i1 > n || i2 > n) return -inf;
  int j1 = dg - i1;
  int j2 = dg - i2;
  if (j1 > n || j2 > n) return -inf;
  if (dg == (2 * n)) return a[i1][j1];
  int &ret = dp[dg][i1][i2];
  if (ret != (-inf)) return ret;
  if (i1 == i2 && j1 == j2) {
    ret = a[i1][j1];
  } else
    ret = a[i1][j1] + a[i2][j2];
  int tmp = -inf;
  for (int x = 0; x <= 1; x++) {
    for (int y = 0; y <= 1; y++) {
      tmp = max(tmp, solve(dg + 1, i1 + x, i2 + y));
    }
  }
  ret += tmp;
  return ret;
}
void init() {
  for (int i = 1; i <= 2 * n; i++)
    for (int j = 1; j <= n; j++)
      for (int k = 1; k <= n; k++) dp[i][j][k] = -inf;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  init();
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) cin >> a[i][j];
  int ses = solve(2, 1, 1);
  cout << ses << endl;
  return 0;
}
