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