#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a[1000][1000], s = 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++) {
    for (long long j = 1; j <= n; j++) {
      if (i == j) {
        s += a[i][j];
      } else if (i + j == n + 1) {
        s += a[i][j];
      } else if (i == (n - 1) / 2 + 1 && j >= 1 && j <= n) {
        s += a[i][j];
      } else if (j == (n - 1) / 2 + 1 && i >= 1 && i <= n) {
        s += a[i][j];
      }
    }
  }
  cout << s << endl;
}
