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