#include <bits/stdc++.h>
int main() {
  int n, m = 0;
  scanf("%d", &n);
  int a[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      scanf("%d", &a[i][j]);
      if ((i == j) || (i == n - j - 1) || (i == (n - 1) / 2) ||
          (j == (n - 1) / 2)) {
        m = m + a[i][j];
      }
    }
  }
  printf("%d", m);
}
