#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<vector<int>> a(n, vector<int>(n));
  int sum = 0;
  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];
  }
  for (int i = n - 1; i >= 0; i--) {
    sum += a[i][n - 1 - i];
  }
  for (int j = 0; j < n; j++) {
    sum += a[(n - 1) / 2][j];
  }
  for (int i = 0; i < n; i++) {
    sum += a[i][(n - 1) / 2];
  }
  sum -= a[(n - 1) / 2][(n - 1) / 2] * 3;
  cout << sum;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
