#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  return x * f;
}
const int maxn = 305;
int n, a[maxn][maxn];
int dp[maxn << 1][maxn][maxn];
int main() {
  n = read();
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) a[i][j] = read();
  memset(dp, 0x8f, sizeof(dp));
  dp[0][1][1] = a[1][1];
  for (int i = 1; i <= 2 * n - 2; i++)
    for (int j = max(1, i + 2 - n); j <= min(i + 1, n); j++)
      for (int k = max(1, i + 2 - n); k <= min(i + 1, n); k++) {
        dp[i][j][k] = max(max(dp[i - 1][j - 1][k - 1], dp[i - 1][j - 1][k]),
                          max(dp[i - 1][j][k - 1], dp[i - 1][j][k]));
        dp[i][j][k] += a[j][i - j + 2];
        if (j != k) dp[i][j][k] += a[k][i - k + 2];
      }
  printf("%d\n", dp[2 * n - 2][n][n]);
  return 0;
}
