#include <bits/stdc++.h>
using namespace std;
const int INF = 1E9;
int n;
int A[310][310];
int DP[605][310][310];
int move1[4] = {0, 0, 1, 1};
int move2[4] = {0, 1, 0, 1};
int f(int depth, int x1, int x2) {
  int y1, y2;
  y1 = depth - x1;
  y2 = depth - x2;
  if (x1 == n - 1 && y1 == n - 1 && x2 == n - 1 && y2 == n - 1)
    return A[n - 1][n - 1];
  if (x1 >= n || x2 >= n || y1 >= n || y2 >= n) return -INF;
  int &ret = DP[depth][x1][x2];
  if (ret != -1) return ret;
  int poin;
  if (x1 == x2)
    poin = A[x1][y1];
  else
    poin = A[x1][y1] + A[x2][y2];
  ret = -INF;
  for (int i = 0; i < 4; i++) {
    ret = max(ret, f(depth + 1, x1 + move1[i], x2 + move2[i]) + poin);
  }
  return ret;
}
int main() {
  int total;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> A[i][j];
    }
  }
  memset(DP, -1, sizeof(DP));
  cout << f(0, 0, 0) << endl;
  return 0;
}
