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