#include <bits/stdc++.h>
using namespace std;
const int MAXN = 301;
int n;
int a[MAXN][MAXN];
int f[2][MAXN][MAXN];
void init() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) scanf("%d", &a[i][j]);
}
void solve() {
  memset(f, 200, sizeof(f));
  f[0][1][1] = a[1][1];
  int k = 0;
  int nx1, ny1, nx2, ny2;
  for (int i = 2; i <= n + n - 1; i++) {
    k = 1 - k;
    memset(f[k], 200, sizeof(f[k]));
    for (int x1 = 1; x1 <= n; x1++) {
      if (x1 > i) break;
      if (i - 1 - x1 > n) continue;
      for (int x2 = 1; x2 <= n; x2++) {
        if (x2 > i) break;
        if (i - 1 - x2 > n) continue;
        nx1 = x1 + 1, ny1 = i - nx1 + 1;
        nx2 = x2 + 1, ny2 = i - nx2 + 1;
        if (nx1 <= n && nx2 <= n && ny1 <= n && ny2 <= n) {
          f[k][nx1][nx2] =
              max(f[k][nx1][nx2],
                  f[1 - k][x1][x2] + a[nx1][ny1] +
                      a[nx2][ny2] * (1 - (nx1 == nx2 && ny1 == ny2)));
        }
        nx2 = x2, ny2 = i - nx2 + 1;
        if (nx1 <= n && nx2 <= n && ny1 <= n && ny2 <= n) {
          f[k][nx1][nx2] =
              max(f[k][nx1][nx2],
                  f[1 - k][x1][x2] + a[nx1][ny1] +
                      a[nx2][ny2] * (1 - (nx1 == nx2 && ny1 == ny2)));
        }
        nx1 = x1, ny1 = i - nx1 + 1;
        if (nx1 <= n && nx2 <= n && ny1 <= n && ny2 <= n) {
          f[k][nx1][nx2] =
              max(f[k][nx1][nx2],
                  f[1 - k][x1][x2] + a[nx1][ny1] +
                      a[nx2][ny2] * (1 - (nx1 == nx2 && ny1 == ny2)));
        }
        nx2 = x2 + 1, ny2 = i - nx2 + 1;
        if (nx1 <= n && nx2 <= n && ny1 <= n && ny2 <= n) {
          f[k][nx1][nx2] =
              max(f[k][nx1][nx2],
                  f[1 - k][x1][x2] + a[nx1][ny1] +
                      a[nx2][ny2] * (1 - (nx1 == nx2 && ny1 == ny2)));
        }
      }
    }
  }
  printf("%d\n", f[k][n][n]);
}
int main() {
  init();
  solve();
  return 0;
}
