#include <bits/stdc++.h>
using namespace std;
const int dx[] = {0, 1};
const int dy[] = {1, 0};
int n, a[301][301], f[605][301][301], tmp;
bool in_map(int x, int y) { return (1 <= x && x <= n && 1 <= y && y <= n); }
int main() {
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++) scanf("%d", &a[i][j]);
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++) f[2][i][j] = -(1000000000);
    f[2][1][1] = a[1][1];
    for (int s = 2; s < n + n; s++) {
      for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++) f[s + 1][i][j] = -(1000000000);
      for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++) {
          if (f[s][i][j] == -(1000000000)) continue;
          for (int ii = 0; ii < 2; ii++)
            if (in_map(i + dx[ii], s - i + dy[ii]))
              for (int jj = 0; jj < 2; jj++)
                if (in_map(j + dx[jj], s - j + dy[jj])) {
                  int i2 = i + dx[ii], j2 = j + dx[jj];
                  if (i2 == j2)
                    tmp = f[s][i][j] + a[i2][s + 1 - i2];
                  else
                    tmp = f[s][i][j] + a[i2][s + 1 - i2] + a[j2][s + 1 - j2];
                  if (tmp > f[s + 1][i2][j2]) {
                    f[s + 1][i2][j2] = tmp;
                  }
                }
        }
    }
    printf("%d\n", f[n + n][n][n]);
  }
  return 0;
}
