#include <bits/stdc++.h>
using namespace std;
int n;
int X[] = {1, 0};
int Y[] = {0, 1};
bool cmp1(int x, int y) {
  if (x >= 0 && y >= 0 && x < n && y < n) return true;
  return false;
}
int val[304][304];
int memo[2 * 304][304][304];
int sol(int id, int ceros1, int ceros2) {
  if (memo[id][ceros1][ceros2] != INT_MAX) return memo[id][ceros1][ceros2];
  int xx1 = id - ceros1, yy1 = ceros1;
  int xx2 = id - ceros2, yy2 = ceros2;
  if (id == n + n - 2) return val[xx1][yy1];
  int ans = -INT_MAX / 3;
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      int xx11 = xx1 + X[i], yy11 = yy1 + Y[i];
      int xx22 = xx2 + X[j], yy22 = yy2 + Y[j];
      if (cmp1(xx11, yy11) && cmp1(xx22, yy22)) {
        if (xx1 == xx2 && yy1 == yy2) {
          ans = max(ans, val[xx1][yy1] + sol(id + 1, (yy1 != yy11) + ceros1,
                                             (yy2 != yy22) + ceros2));
        } else {
          ans = max(ans, val[xx1][yy1] + val[xx2][yy2] +
                             sol(id + 1, (yy1 != yy11) + ceros1,
                                 (yy2 != yy22) + ceros2));
        }
      }
    }
  }
  return memo[id][ceros1][ceros2] = ans;
}
int main() {
  int x;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      scanf("%d", &val[i][j]);
    }
  }
  for (int i = 0; i <= 2 * n; i++) {
    for (int j = 0; j <= n; j++) {
      for (int k = 0; k <= n; k++) {
        memo[i][j][k] = INT_MAX;
      }
    }
  }
  cout << sol(0, 0, 0) << endl;
  return 0;
}
