#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int x;
  scanf("%d", &x);
  return x;
}
const int INF = 1e9 + 10;
const long long LINF = 1000ll * 1000 * 1000 * 1000 * 1000 * 1000 + 100;
const int MN = 3e2 + 10;
int n;
int dp[2 * MN][MN][MN];
int arr[MN][MN];
bool valid(int r, int c) {
  if (min(r, c) < 0 || max(r, c) >= n) return false;
  return true;
}
void input() {
  cin >> n;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) cin >> arr[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] = -INF;
}
int make(int d, int r1, int r2) {
  if (dp[d][r1][r2] != -INF) return dp[d][r1][r2];
  if (d == 0) {
    if (r1 != 0 || r2 != 0) return dp[d][r1][r2];
    return dp[d][r1][r2] = arr[0][0];
  }
  int t = arr[r1][d - r1] + arr[r2][d - r2];
  if (r1 == r2) t -= arr[r1][d - r1];
  if (valid(r1, d - 1 - r1) && valid(r2, d - 1 - r2))
    dp[d][r1][r2] = max(dp[d][r1][r2], make(d - 1, r1, r2) + t);
  if (valid(r1, d - 1 - r1) && valid(r2 - 1, d - r2))
    dp[d][r1][r2] = max(dp[d][r1][r2], make(d - 1, r1, r2 - 1) + t);
  if (valid(r1 - 1, d - r1) && valid(r2, d - 1 - r2))
    dp[d][r1][r2] = max(dp[d][r1][r2], make(d - 1, r1 - 1, r2) + t);
  if (valid(r1 - 1, d - r1) && valid(r2 - 1, d - r2))
    dp[d][r1][r2] = max(dp[d][r1][r2], make(d - 1, r1 - 1, r2 - 1) + t);
  return dp[d][r1][r2];
}
int main() {
  input();
  cout << make(2 * n - 2, n - 1, n - 1) << endl;
  return 0;
}
