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