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