#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<vector<int>> mat;
  for (int i = 0; i < n; i++) {
    vector<int> v;
    for (int j = 0; j < n; j++) {
      int x;
      cin >> x;
      v.push_back(x);
    }
    mat.push_back(v);
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == (n - 1) / 2 || j == (n - 1) / 2 || i == j || j == n - 1 - i)
        ans += mat[i][j];
    }
  }
  cout << ans;
}
int main() {
  int T = 1;
  while (T--) {
    solve();
  }
}
