#include <bits/stdc++.h>
using namespace std;
typedef char* cstr;
const int oo = (~0u) >> 1;
const long long int ool = (~0ull) >> 1;
const double inf = 1e100;
const double eps = 1e-8;
const double pi = acos(-1.0);
template <typename type>
inline void cmax(type& a, const type& b) {
  if (a < b) a = b;
}
template <typename type>
inline void cmin(type& a, const type& b) {
  if (a > b) a = b;
}
int n;
int c[1000];
int k[1000];
int a[300][300];
int f[600][300][300];
int main() {
  cin >> n;
  for (int i = 0; i < (n); ++i)
    for (int j = 0; j < (n); ++j) cin >> a[i][j];
  for (int i = 0; i < (n * 2 - 1); ++i)
    for (int x1 = 0; x1 < (min(i + 1, n)); ++x1)
      for (int x2 = 0; x2 < (min(i + 1, n)); ++x2) {
        int y1 = i - x1;
        int y2 = i - x2;
        f[i][x1][x2] = a[x1][y1] + (x1 == x2 ? 0 : a[x2][y2]);
        if (i) {
          int d = -oo;
          if (x1 < i && x2 < i) cmax(d, f[i - 1][x1][x2]);
          if (x1 && x2) cmax(d, f[i - 1][x1 - 1][x2 - 1]);
          if (x1 && x2 < i) cmax(d, f[i - 1][x1 - 1][x2]);
          if (x2 && x1 < i) cmax(d, f[i - 1][x1][x2 - 1]);
          f[i][x1][x2] += d;
        }
      }
  cout << f[(n - 1) * 2][n - 1][n - 1] << endl;
}
