#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const int EPS = 1e-6;
int a[1000][1000];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  int n, cnt = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    cnt += a[i][i];
    a[i][i] = 0;
  }
  int k = n;
  for (int i = 1; i <= n; i++) {
    cnt += a[i][k];
    a[i][k] = 0;
    k--;
  }
  for (int i = 1; i <= n; i++) {
    cnt += a[i][n / 2 + 1];
    a[i][n / 2 + 1] = 0;
  }
  for (int i = 1; i <= n; i++) {
    cnt += a[n / 2 + 1][i];
    a[n / 2 + 1][i] = 0;
  }
  cout << cnt;
  return 0;
}
