#include <bits/stdc++.h>
using namespace std;
int main() {
  clock_t start = clock();
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int mas[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> mas[i][j];
    }
  }
  int sum = 0;
  int ort;
  if (n == 1) {
    cout << mas[0][0];
    return 0;
  }
  int sum1 = 0;
  int sum2 = 0;
  int sum3 = 0;
  int sum4 = 0;
  ort = ceil(n / 2);
  int san = n - 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j) sum1 += mas[i][j];
      if (i + j == san) sum2 += mas[i][j];
      if (i == ort) sum3 += mas[i][j];
      if (j == ort) sum4 += mas[i][j];
    }
  }
  cout << sum1 + sum2 + sum3 + sum4 - (mas[ort][ort] * 3);
  clock_t end = clock();
  double seconds = (double)(end - start) / CLOCKS_PER_SEC;
  return 0;
}
