#include <bits/stdc++.h>
using namespace std;
long long int N, M, a, b, T;
void solve() {
  cin >> N;
  long long int a[N][N];
  long long int sum = 0;
  for (long long int i = 0; i < N; i++) {
    for (long long int j = 0; j < N; j++) cin >> a[i][j];
  }
  for (long long int i = 0; i < N; i++) {
    sum += a[i][i];
    sum += a[i][N - 1 - i];
  }
  for (long long int i = 0; i < N; i++) {
    sum += a[i][(N - 1) / 2];
    sum += a[(N - 1) / 2][i];
  }
  cout << sum - 3 * a[N / 2][N / 2] << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  T = 1;
  while (T--) solve();
  return 0;
}
