#include <bits/stdc++.h>
using namespace std;
int n, a[305][305];
int p[2] = {0, 1};
int memo[305][305][305];
int dfss(int x1, int x2, int tot) {
  if (memo[x1][x2][tot] != -1) return memo[x1][x2][tot];
  if (x1 == n && x2 == n && tot == 2 * n) return 0;
  int hsl = -900000;
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      int lol1 = x1 + p[i];
      int lol2 = x2 + p[j];
      if (x1 > n || x2 > n || (tot - x1) > n || (tot - x2) > n) continue;
      if (lol1 == lol2)
        hsl = max(hsl, dfss(lol1, lol2, tot + 1) + a[lol1][tot - lol1 + 1]);
      else
        hsl = max(hsl, dfss(lol1, lol2, tot + 1) + a[lol1][tot - lol1 + 1] +
                           a[lol2][tot - lol2 + 1]);
    }
  }
  return memo[x1][x2][tot] = hsl;
}
int main() {
  scanf("%d", &n);
  memset(memo, -1, sizeof(memo));
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  int ans = dfss(1, 1, 2);
  printf("%d\n", ans + a[1][1]);
  return 0;
}
