#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000;
const int Max = 300 + 10;
int dp[2 * Max][Max][Max];
int a[Max][Max];
int n, m;
int c[4][2] = {{1, 1}, {0, 0}, {1, 0}, {0, 1}};
int dyn(int s, int x1, int x2) {
  int y1 = s - x1;
  int y2 = s - x2;
  if (x1 < 0 || x2 < 0 || y1 < 0 || y2 < 0 || x1 >= n || x2 >= n || y1 >= n ||
      y2 >= n)
    return -INF;
  if (dp[s][x1][x2] != -INF) return dp[s][x1][x2];
  if (x1 == n - 1 && x2 == n - 1 && y1 == n - 1 && y2 == n - 1)
    return a[n - 1][n - 1];
  int ma = -INF;
  for (int i = 0; i < 4; ++i)
    ma = max(ma, dyn(s + 1, x1 + c[i][0], x2 + c[i][1]));
  ma += a[x1][y1] + a[x2][y2];
  if (x1 == x2 && y1 == y2) ma -= a[x1][y1];
  dp[s][x1][x2] = ma;
  return ma;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) cin >> a[i][j];
  for (int s = 0; s < 2 * n; ++s)
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < n; ++j) dp[s][i][j] = -INF;
  cout << dyn(0, 0, 0) << endl;
  return 0;
}
