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