#include <bits/stdc++.h>
int main() {
  int a, i, p, b;
  scanf("%d", &a);
  b = 0;
  int z[105][105];
  for (i = 0; i < a; i++)
    for (p = 0; p < a; p++) scanf("%d", &z[i][p]);
  for (i = 0; i < a; i++) {
    b += z[a / 2][i];
    b += z[i][a / 2];
    b += z[i][i];
    b += z[i][a - 1 - i];
  }
  b = b - 3 * z[a / 2][a / 2];
  printf("%d\n", b);
}
