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