#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  scanf("%d", &n);
  int centro, sum = 0, el;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      scanf("%d", &el);
      if (i == j || i + j == n - 1 || i == (n - 1) / 2 || j == (n - 1) / 2)
        sum += el;
      if (i == (n - 1) / 2 && j == (n - 1) / 2) centro = el;
    }
  }
  printf("%d", sum);
}
