#include <bits/stdc++.h>
int main() {
  int n;
  int i, j;
  int num[500][500];
  while (~scanf("%d", &n)) {
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++) {
        scanf("%d", &num[i][j]);
      }
    }
    int sum1 = 0, sum2 = 0, sum3 = 0, sum = 0;
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++) {
        if (i == (n + 1) / 2 || j == (n + 1) / 2) {
          sum1 += num[i][j];
        }
        if (i == j) sum2 += num[i][j];
        if (j == n + 1 - i) sum3 += num[i][j];
      }
    }
    sum = sum1 + sum2 + sum3;
    printf("%d", sum - 2 * num[(n + 1) / 2][(n + 1) / 2]);
  }
  return 0;
}
