#include <bits/stdc++.h>
using namespace std;
template <typename t>
t in(t q) {
  cin >> q;
  return q;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "[";
  for (int i = 0; i < ((int)(v).size()); ++i) {
    os << v[i];
    if (i != ((int)(v).size()) - 1) os << ",";
  }
  os << "]";
  return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, const map<T, S>& v) {
  for (auto it : v) os << "(" << it.first << ":" << it.second << ")";
  return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, const pair<T, S>& v) {
  os << "(" << v.first << "," << v.second << ")";
  return os;
}
const long double PI = acosl(-1);
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng64(chrono::steady_clock::now().time_since_epoch().count());
inline int rand(int l, int r) {
  return uniform_int_distribution<int>(l, r)(rng);
}
inline long long rand(long long l, long long r) {
  return uniform_int_distribution<long long>(l, r)(rng64);
}
int a[(305)][(305)];
int dp[2 * (305)][(305)][(305)];
int ans(int diag, int r1, int r2) {
  if (r1 < 0 || r2 < 0 || diag < 0 || diag - r1 < 0 || diag - r2 < 0) {
    return -(1050000000);
  }
  if (r1 == 0 && r2 == 0 && diag == 0) {
    return a[0][0];
  }
  if (dp[diag][r1][r2] != -1) {
    return dp[diag][r1][r2];
  }
  int an = a[r1][diag - r1] + a[r2][diag - r2] +
           max({ans(diag - 1, r1, r2), ans(diag - 1, r1 - 1, r2),
                ans(diag - 1, r1, r2 - 1), ans(diag - 1, r1 - 1, r2 - 1)});
  if (r1 == r2) {
    an -= a[r1][diag - r1];
  }
  dp[diag][r1][r2] = an;
  return an;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << setprecision(10);
  memset(dp, -1, sizeof dp);
  int n;
  cin >> n;
  for (auto i = 0; i < n; i++) {
    for (auto j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  cout << ans(2 * n - 2, n - 1, n - 1);
  return 0;
}
