#include <bits/stdc++.h>
using namespace std;
int pos[305][305];
int dp[2][305][305];
int max(int i, int j) { return i > j ? i : j; }
int main() {
  int n, arr[305][305];
  scanf("%d", &n);
  int i, j, k, l;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) scanf("%d", &arr[i][j]);
  }
  int x, y, a, b, c, d, p, q;
  for (i = 1; i <= 2 * n - 1; i++) {
    if (i <= n) {
      x = i;
      y = 1;
    } else {
      x = n;
      y = i - n + 1;
    }
    int pp = 1;
    for (a = x, b = y; a > 0 && b <= n; a--, b++) {
      pos[a][b] = pp;
      pp++;
    }
  }
  int prev = 1, cur = 0;
  dp[prev][1][1] = arr[n][n];
  for (i = 2 * n - 2; i >= 1; i--) {
    if (i <= n) {
      x = i;
      y = 1;
    } else {
      x = n;
      y = i - n + 1;
    }
    for (a = x, b = y; a > 0 && b <= n; a--, b++) {
      for (c = x, d = y; c > 0 && d <= n; c--, d++) {
        p = pos[a][b];
        q = pos[c][d];
        if (p == q)
          dp[cur][p][q] = arr[a][b];
        else
          dp[cur][p][q] = arr[a][b] + arr[c][d];
        int tmp = -1000000000;
        if (a + 1 <= n && c + 1 <= n)
          tmp = max(tmp, dp[prev][pos[a + 1][b]][pos[c + 1][d]]);
        if (a + 1 <= n && d + 1 <= n)
          tmp = max(tmp, dp[prev][pos[a + 1][b]][pos[c][d + 1]]);
        if (b + 1 <= n && c + 1 <= n)
          tmp = max(tmp, dp[prev][pos[a][b + 1]][pos[c + 1][d]]);
        if (b + 1 <= n && d + 1 <= n)
          tmp = max(tmp, dp[prev][pos[a][b + 1]][pos[c][d + 1]]);
        dp[cur][p][q] += tmp;
      }
    }
    swap(cur, prev);
  }
  printf("%d\n", dp[prev][1][1]);
  return 0;
}
