#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:60777216")
using namespace std;
int n;
int d[300][300];
int dp[300][300][300];
bool was[300][300][300];
int dx[] = {1, 0};
int dy[] = {0, 1};
inline bool valid(int i, int j, int k) {
  int l = i + j - k;
  if (i >= 0 && i < n && j >= 0 && j < n) {
    if (k >= 0 && k < n && l >= 0 && l < n) {
      return true;
    }
  }
  return false;
}
int solve(int i, int j, int k) {
  if (i + j == 2 * (n - 1)) {
    return d[n - 1][n - 1];
  }
  if (was[i][j][k]) {
    return dp[i][j][k];
  }
  was[i][j][k] = true;
  dp[i][j][k] = -10000000;
  for (int dir1 = 0; dir1 < 2; ++dir1) {
    for (int dir2 = 0; dir2 < 2; ++dir2) {
      if (valid(i + dx[dir1], j + dy[dir1], k + dx[dir2])) {
        if (i == k && j == i + j - k) {
          dp[i][j][k] =
              max(dp[i][j][k],
                  d[i][j] + solve(i + dx[dir1], j + dy[dir1], k + dx[dir2]));
        } else {
          dp[i][j][k] = max(
              dp[i][j][k], d[i][j] + d[k][i + j - k] +
                               solve(i + dx[dir1], j + dy[dir1], k + dx[dir2]));
        }
      }
    }
  }
  return dp[i][j][k];
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      scanf("%d", d[i] + j);
    }
  }
  cout << solve(0, 0, 0) << endl;
  return 0;
}
