#include <bits/stdc++.h>
using namespace std;
long long n, cnt, x;
long long a[1001][1001];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) cin >> a[i][j];
  }
  for (long long i = 1; i <= n; i++) {
    cnt += a[i][i];
    a[i][i] = 0;
  }
  x = n;
  for (long long i = 1; i <= n; i++) {
    cnt += a[i][x];
    a[i][x] = 0;
    x--;
  }
  x = n / 2 + 1;
  for (long long i = 1; i <= n; i++) {
    cnt += a[i][x];
    a[i][x] = 0;
    cnt += a[x][i];
    a[x][i] = 0;
  }
  cout << cnt;
}
