#include <bits/stdc++.h>
using namespace std;
int n, x, s = 0, i, j;
int main() {
  cin >> n;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      cin >> x;
      if ((i == n / 2) || (j == n / 2) || (i == j) || (n - i == j + 1)) s += x;
    }
  cout << s << endl;
  return 0;
}
