#include <bits/stdc++.h>
using namespace std;
int f[320][320][360], N, in[320][320];
const int INF = 0x3fffffff;
int dp(int i, int j, int x);
int main() {
  int i, j, k, y;
  scanf("%d", &N);
  for (i = 0; i <= N; ++i)
    for (j = 0; j <= N; ++j)
      for (k = 0; k <= N; ++k) f[i][j][k] = -INF;
  for (i = 1; i <= N; ++i)
    for (j = 1; j <= N; ++j) scanf("%d", &in[i][j]);
  f[1][1][1] = in[1][1];
  for (i = 1; i <= N; ++i)
    for (j = 1; j <= N; ++j)
      for (k = 1; k <= N; ++k) {
        if (i == 1 && j == 1) continue;
        y = i + j - k;
        if (y < 1) continue;
        f[i][j][k] = -INF;
        f[i][j][k] = max(f[i][j][k], f[i - 1][j][k - 1]);
        f[i][j][k] = max(f[i][j][k], f[i - 1][j][k]);
        f[i][j][k] = max(f[i][j][k], f[i][j - 1][k - 1]);
        f[i][j][k] = max(f[i][j][k], f[i][j - 1][k]);
        f[i][j][k] += in[i][j];
        if (i != k) f[i][j][k] += in[k][y];
      }
  printf("%d\n", f[N][N][N]);
  return 0;
}
