#include <bits/stdc++.h>
using namespace std;
int M[310][310];
int n;
int pd[2 * 310][310][310];
int Vx[] = {1, 0};
int Vy[] = {0, 1};
inline bool fora(int x, int y) {
  if (max(x, y) >= n) return 1;
  return 0;
}
int solve(int p, int l1, int l2) {
  if (p == n + n - 2) return 0;
  int& ret = pd[p][l1][l2];
  if (ret != -1) return ret;
  int c1 = p - l1, c2 = p - l2;
  ret = -1000000000;
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++) {
      int x1 = l1 + Vx[i], y1 = c1 + Vy[i];
      int x2 = l2 + Vx[j], y2 = c2 + Vy[j];
      if (fora(x1, y1) || fora(x2, y2)) continue;
      int s = M[x1][y1] + M[x2][y2];
      if (x1 == x2) s -= M[x1][y1];
      ret = max(ret, s + solve(p + 1, x1, x2));
    }
  return ret;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> M[i][j];
  memset(pd, -1, sizeof pd);
  cout << M[0][0] + solve(0, 0, 0) << endl;
  return 0;
}
