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