#include <bits/stdc++.h>
using namespace std;
const int INVALID = INT_MAX;
int pts[305][305];
int dp[2 * 305][305][305];
inline int _dp(int d, int r1, int r2) {
  if (r1 < 0 || r2 < 0 || d < 0) return -100000000;
  if (dp[d][r1][r2] != INVALID) return dp[d][r1][r2];
  int maximum = max(max(_dp(d - 1, r1 - 1, r2 - 1), _dp(d - 1, r1 - 1, r2)),
                    max(_dp(d - 1, r1, r2 - 1), _dp(d - 1, r1, r2)));
  maximum += pts[r1][d - r1];
  if (r1 != r2) maximum += pts[r2][d - r2];
  dp[d][r1][r2] = maximum;
  return maximum;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) cin >> pts[i][j];
  for (int i = 0; i < 2 * n; ++i)
    for (int j = 0; j < n; ++j)
      for (int k = 0; k < n; ++k) dp[i][j][k] = INVALID;
  dp[0][0][0] = pts[0][0];
  cout << _dp(2 * n - 2, n - 1, n - 1);
  return 0;
}
