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