#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k = 0, i;
  cin >> n;
  int a[n][n], j;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) cin >> a[i][j];
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (i == j || i + j == (n - 1) || i == (n - 1) / 2 || j == (n - 1) / 2) {
        k = k + a[i][j];
      }
    }
  }
  cout << k;
  return 0;
}
