#include <bits/stdc++.h>
int main() {
  int n, s = 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]);
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i == j)
        s = s + a[i][j];
      else if (i + j == n - 1)
        s = s + a[i][j];
    }
  }
  for (int i = 0; i < n; ++i) {
    s = s + a[n / 2][i];
    s = s + a[i][n / 2];
  }
  s = s - (2 * a[n / 2][n / 2]);
  printf("%d", s);
}
