#include <bits/stdc++.h>
using namespace std;
int n, dp[301][301][301], vis[301][301][301], a[301][301];
int valid(int x, int y) { return (x >= 1 && x <= n && y >= 1 && y <= n); }
int solve(int x1, int y1, int x2) {
  int y2 = x1 + y1 - x2;
  if (!valid(x1, y1) || !valid(x2, y2)) return -10000000;
  if (x1 == n && y1 == n && x2 == n) return a[n][n];
  if (vis[x1][y1][x2]) return dp[x1][y1][x2];
  int ans = -10000000;
  ans = max(ans, solve(x1 + 1, y1, x2));
  ans = max(ans, solve(x1 + 1, y1, x2 + 1));
  ans = max(ans, solve(x1, y1 + 1, x2));
  ans = max(ans, solve(x1, y1 + 1, x2 + 1));
  ans += a[x1][y1] + a[x2][y2];
  if (x1 == x2 && y1 == y2) ans = ans - a[x1][y1];
  vis[x1][y1][x2] = 1;
  dp[x1][y1][x2] = ans;
  return ans;
}
int main() {
  int i, j;
  cin >> n;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) cin >> a[i][j];
  }
  cout << solve(1, 1, 1);
  return 0;
}
