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