#include <bits/stdc++.h>
using namespace std;
int const MAXN = 300;
long long const INF = 1e17;
int m[300][300];
long long dp[300][300][300];
int n;
long long solve(int x1, int y1, int x2) {
  int y2 = x1 + y1 - x2;
  if (x1 < 0 || x1 >= n || y1 < 0 || y1 >= n || x2 < 0 || x2 >= n || y2 < 0 ||
      y2 >= n)
    return -INF;
  long long &x = dp[x1][y1][x2];
  if (x != -INF) return dp[x1][y1][x2];
  x = max(x, solve(x1 - 1, y1, x2 - 1));
  x = max(x, solve(x1, y1 - 1, x2));
  x = max(x, solve(x1 - 1, y1, x2));
  x = max(x, solve(x1, y1 - 1, x2 - 1));
  x += m[x1][y1] + (x1 == x2 && y1 == y2 ? 0 : m[x2][y2]);
  return x;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> m[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      for (int k = 0; k < n; k++) {
        dp[i][j][k] = -INF;
      }
    }
  }
  dp[0][0][0] = m[0][0];
  long long answer = solve(n - 1, n - 1, n - 1);
  cout << answer << '\n';
}
