#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  solve();
  return 0;
}
void solve() {
  long long n;
  cin >> n;
  long long mat[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> mat[i][j];
    }
  }
  long long mid_row = (n - 1) / 2;
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    if (i != mid_row) {
      sum += mat[i][i];
      sum += mat[i][mid_row];
      sum += mat[i][(n - 1) - i];
    }
  }
  for (int i = 0; i < n; i++) {
    sum += mat[mid_row][i];
  }
  cout << sum << "\n";
}
