#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int n;
int mat[301][301];
int dp[301][301][602];
int solve(int x1, int x2, int diag) {
  if (diag > (2 * (n - 1))) return 0;
  if (x1 >= n or x2 >= n) return -MOD;
  int y1 = diag - x1;
  int y2 = diag - x2;
  if (y1 >= n or y2 >= n) return -MOD;
  if (dp[x1][x2][diag] != -1) return dp[x1][x2][diag];
  int ans = -MOD;
  for (int i = 0; i <= 1; i++) {
    for (int j = 0; j <= 1; j++) {
      ans = max(ans, solve(x1 + i, x2 + j, diag + 1));
    }
  }
  if (x1 == x2 and y1 == y2)
    ans += (mat[x1][y1]);
  else
    ans += (mat[x1][y1] + mat[x2][y2]);
  dp[x1][x2][diag] = ans;
  return ans;
}
signed main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> mat[i][j];
    }
  }
  memset(dp, -1, sizeof dp);
  cout << solve(0, 0, 0);
}
