#include <bits/stdc++.h>
using namespace std;
template <class T>
T power(T N, T P) {
  return (P == 0) ? 1 : N * power(N, P - 1);
}
template <class T>
T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
const int N = 300 + 5;
int inf = (1 << 28);
int a[N][N], dp[N][N][N], n;
int rec(int x1, int y1, int x2) {
  int y2 = (x1 + y1) - x2;
  int &ret = dp[x1][y1][x2];
  if (ret != -1) return ret;
  if (x1 > n || x2 > n || y1 > n | y2 > n) return -inf;
  if (x1 == n && y1 == n) return a[x1][y1];
  ret = rec(x1 + 1, y1, x2);
  ret = max(ret, rec(x1, y1 + 1, x2));
  ret = max(ret, rec(x1 + 1, y1, x2 + 1));
  ret = max(ret, rec(x1, y1 + 1, x2 + 1));
  if (x1 == x2 && y1 == y2)
    ret += a[x1][y1];
  else
    ret += a[x1][y1] + a[x2][y2];
  return ret;
}
int main() {
  while (scanf("%d", &n) != EOF) {
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++) scanf("%d", &a[i][j]);
    memset(dp, -1, sizeof(dp));
    printf("%d\n", rec(1, 1, 1));
  }
  return 0;
}
