#include <bits/stdc++.h>
using namespace std;
const int infl = 1e8 + 5;
int n, m, k, q, x, y, f, val, t = 1, i, j;
int ind = -1, cnt, sz, sm, ans, mx = -1, mn = infl;
int a[304][304], dp[304 + 304][304][304];
int rec(int d, int x1, int x2) {
  if (d > n + n - 2) return 0;
  if (x1 >= n || x2 >= n) return -infl;
  int y1 = d - x1, y2 = d - x2, re = 0;
  if (y1 >= n || y2 >= n) return -infl;
  if (dp[d][x1][x2] != -1) return dp[d][x1][x2];
  re = max({rec(d + 1, x1, x2 + 1), rec(d + 1, x1 + 1, x2 + 1),
            rec(d + 1, x1, x2), rec(d + 1, x1 + 1, x2)});
  if (x1 == x2 && y1 == y2)
    re += a[x1][y1];
  else
    re += a[x1][y1] + a[x2][y2];
  dp[d][x1][x2] = re;
  return re;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  if (fopen("inp.txt", "r")) {
    freopen("myfile.txt", "w", stdout);
    freopen("inp.txt", "r", stdin);
  }
  cin >> n;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  memset(dp, -1, sizeof(dp));
  cout << rec(0, 0, 0);
  return 0;
}
