#include <bits/stdc++.h>
using namespace std;
int i, j, l, n, a[301][301], f[601][301][301], ii, jj, ans = -1000000000;
int add(int n, int i, int j) {
  if (i == j)
    return a[n - i][i];
  else
    return a[n - i][i] + a[n - j][j];
}
int main() {
  cin >> n;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) cin >> a[i][j];
  for (l = 0; l <= 600; l++)
    for (i = 0; i <= 300; i++)
      for (j = 0; j <= 300; j++) f[l][i][j] = -1000000000;
  f[0][0][0] = a[0][0];
  for (l = 0; l < 2 * n - 2; l++) {
    int l1 = 0, l2 = l;
    if (n <= l) l1 = l - n + 1;
    if (n <= l) l2 = n - 1;
    for (i = l1; i <= l2; i++)
      for (j = l1; j <= l2; j++)
        for (ii = 0; ii < 2; ii++)
          for (jj = 0; jj < 2; jj++)
            f[l + 1][i + ii][j + jj] =
                max(f[l + 1][i + ii][j + jj],
                    f[l][i][j] + add(l + 1, i + ii, j + jj));
  }
  cout << f[2 * n - 2][n - 1][n - 1] << endl;
}
