#include <bits/stdc++.h>
using namespace std;
int a[301][301];
int d[601][301][301];
int main() {
  int n, i, j, k;
  cin >> n;
  memset(a, 0, sizeof(a));
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) cin >> a[i][j];
  for (i = 0; i <= n; i++)
    for (j = 0; j <= n; j++)
      for (k = 0; k <= 2 * n - 1; k++) d[k][i][j] = -999999999;
  d[1][1][1] = a[1][1];
  for (k = 2; k <= 2 * n - 1; k++)
    for (int i1 = 1; i1 <= n; i1++)
      for (int i2 = 1; i2 <= n; i2++) {
        int j1 = (k - i1) + 1, j2 = (k - i2) + 1;
        d[k][i1][i2] = max(d[k][i1][i2], d[k - 1][i1][i2]);
        d[k][i1][i2] = max(d[k][i1][i2], d[k - 1][i1 - 1][i2]);
        d[k][i1][i2] = max(d[k][i1][i2], d[k - 1][i1][i2 - 1]);
        d[k][i1][i2] = max(d[k][i1][i2], d[k - 1][i1 - 1][i2 - 1]);
        d[k][i1][i2] += a[i1][j1] + ((i1 == i2) ? 0 : a[i2][j2]);
      }
  cout << d[2 * n - 1][n][n] << endl;
  return 0;
}
