#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
#pragma warning(disable : 4786)
using namespace std;
int MIN(int a, int b) { return a < b ? a : b; }
int MAX(int a, int b) { return a > b ? a : b; }
int GCD(int a, int b) {
  while (b) b ^= a ^= b ^= a %= b;
  return a;
}
int LCM(int a, int b) { return a * (b / GCD(a, b)); }
void SWAP(int &a, int &b) {
  a = a ^ b;
  b = a ^ b;
  a = a ^ b;
}
const double PI = acos(-1);
const double EPS = 1e-11;
int arr[310][310], memo[310][310][310], N, M;
int dp(int i, int j, int k) {
  int l = i + j - k;
  if (i == N - 1 && j == M - 1) {
    return arr[i][j];
  }
  if (i == N || j == M || k >= N || l >= N) {
    return -(1 << 29);
    ;
  }
  int &ret = memo[i][j][k];
  if (ret != -1) {
    return ret;
  }
  int res, r1, val;
  res = -(1 << 29);
  ;
  if (i == k && j == l) {
    val = arr[i][j];
  } else {
    val = arr[i][j] + arr[k][l];
  }
  r1 = dp(i + 1, j, k + 1) + val;
  res = MAX(res, r1);
  r1 = dp(i + 1, j, k) + val;
  res = MAX(res, r1);
  r1 = dp(i, j + 1, k + 1) + val;
  res = MAX(res, r1);
  r1 = dp(i, j + 1, k) + val;
  res = MAX(res, r1);
  return ret = res;
}
int main() {
  int T, res, n, i, ind, m, j;
  while (scanf("%d", &n) != EOF) {
    int a = -(1 << 29);
    ;
    memset(memo, -1, sizeof(memo));
    memset(arr, 0, sizeof(arr));
    m = n;
    for (i = 0; i < (n); i++) {
      for (j = 0; j < (m); j++) {
        scanf("%d", &arr[i][j]);
      }
    }
    N = n;
    M = m;
    res = dp(0, 0, 0);
    printf("%d\n", res);
  }
  return 0;
}
