#include <bits/stdc++.h>
using namespace std;
inline void boost() {
  ios_base::sync_with_stdio();
  cin.tie(0);
  cout.tie(0);
}
const long long maxn = 1e3 + 123;
const long long inf = 1e9 + 123;
const long long mod = 1e9 + 7;
const double pi = acos(-1);
int a[maxn][maxn], used[maxn][maxn];
int main() {
  boost();
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
    }
  }
  long long cntr = 0;
  for (int i = 1; i <= n; i++) {
    if (used[i][i] == 0) {
      cntr += a[i][i];
      used[i][i] = 1;
    }
  }
  int r = 1;
  for (int i = n; i >= 1; i--) {
    if (used[i][r] == 0) {
      cntr += a[i][r];
      used[i][r] = 1;
    }
    r++;
  }
  for (int i = 1; i <= n; i++) {
    if (used[i][(n + 1) / 2] == 0) {
      cntr += a[i][(n + 1) / 2];
      used[i][(n + 1) / 2] = 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (used[(n + 1) / 2][i] == 0) {
      cntr += a[(n + 1) / 2][i];
      used[(n + 1) / 2][i] = 1;
    }
  }
  cout << cntr;
  return 0;
}
