#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
int main() {
  lint n;
  cin >> n;
  vector<lint> matrix(n * n);
  for (lint i = 0; i < n; i++) {
    for (lint j = 0; j < n; j++) {
      cin >> matrix[i * n + j];
    }
  }
  lint sum = 0;
  for (lint i = 0; i < n; i++) {
    for (lint j = 0; j < n; j++) {
      if ((i == j) || (i == (n - 1 - j) || (i == n / 2) || (j == n / 2))) {
        sum += matrix[i * n + j];
      }
    }
  }
  cout << sum << endl;
  return 0;
}
