#include <bits/stdc++.h>
using namespace std;
int row, col;
int v[301][301];
int dp[301][301][301];
bool visit[301][301][301];
int rec(int r1, int r2, int stp) {
  int c1 = abs(r1 - stp), c2 = abs(r2 - stp);
  if (r1 >= row || r2 >= row || c1 >= col || c2 >= col) return -1073741823;
  if (r1 == row - 1 && c1 == col - 1) return v[r1][c1];
  int &ret = dp[r1][r2][stp];
  if (visit[r1][r2][stp]) return ret;
  visit[r1][r2][stp] = true;
  int cnt = 0;
  cnt = v[r1][c1];
  if (r1 != r2 || c1 != c2) cnt += v[r2][c2];
  ret = rec(r1, r2, stp + 1) + cnt;
  ret = max(ret, rec(r1, r2 + 1, stp + 1) + cnt);
  ret = max(ret, rec(r1 + 1, r2, stp + 1) + cnt);
  ret = max(ret, rec(r1 + 1, r2 + 1, stp + 1) + cnt);
  return ret;
}
int main(void) {
  int ans;
  scanf("%d", &row);
  col = row;
  for (int p = 0; p < row; p++)
    for (int q = 0; q < col; q++) scanf("%d", &v[p][q]);
  ans = rec(0, 0, 0);
  printf("%d\n", ans);
  return 0;
}
