#include <bits/stdc++.h>
using namespace std;
template <class stl>
void DBGSTL(stl a) {
  for (__typeof((a).begin()) i = (a).begin(); i != (a).end(); i++) {
    cerr << *i << " ";
  }
  cerr << "\n";
  return;
}
using namespace std;
int mem[305][305][305];
int done[305][305][305];
int grid[305][305];
int n;
int dp(int r1, int c1, int r2, int c2, int step) {
  if (r1 == n - 1 && r2 == n - 1 && c1 == n - 1 && c2 == n - 1) {
    return grid[r1][c2];
  }
  if (r1 >= n || r2 >= n || c1 >= n || c2 >= n) return -1234567891;
  if (done[r1][r2][step]) {
    return mem[r1][r2][step];
  }
  int val = grid[r1][c1];
  if (r1 != r2 || c1 != c2) {
    val += grid[r2][c2];
  }
  int ret = -1234567891;
  ret = max(ret, val + dp(r1 + 1, c1, r2 + 1, c2, step + 1));
  ret = max(ret, val + dp(r1, c1 + 1, r2, c2 + 1, step + 1));
  ret = max(ret, val + dp(r1 + 1, c1, r2, c2 + 1, step + 1));
  ret = max(ret, val + dp(r1, c1 + 1, r2 + 1, c2, step + 1));
  done[r1][r2][step] = 1;
  return mem[r1][r2][step] = ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      scanf("%d", &grid[i][j]);
    }
  }
  memset((done), (0), sizeof(done));
  memset((mem), (0), sizeof(mem));
  if (n == 1) {
    cout << grid[0][0] << endl;
  } else
    cout << dp(0, 0, 0, 0, 0) << "\n";
  return 0;
}
