#include <bits/stdc++.h>
using namespace std;
map<char, long long> mp, pm;
vector<long long> v;
deque<long long> p;
long long a, b, c, d, e, cnt, ans, r, n;
string g, h;
char t, y, u;
int main() {
  cout.tie(NULL);
  cin.tie(NULL);
  ios_base::sync_with_stdio(0);
  cin >> n;
  cnt = n / 2 + 1;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) {
      cin >> a;
      if (i == j or i + j == n + 1 or i == cnt or j == cnt) ans += a;
    }
  }
  cout << ans;
}
