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