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