#include <bits/stdc++.h>
using namespace std;
const int inf = 1000 * 1000 * 1000;
int main() {
  int n;
  scanf("%d", &n);
  int S = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      int t;
      scanf("%d", &t);
      if (i == j || i == n - j - 1 || i == (n) / 2 || j == (n) / 2) S += t;
    }
  }
  printf("%d", S);
  return 0;
}
