#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int **arr = new int *[n];
  for (int i = 0; i < n; i++) {
    arr[i] = new int[n];
    for (int j = 0; j < n; j++) {
      scanf("%d", &arr[i][j]);
    }
  }
  int nSumm = 0;
  int nLeftIndex = 0, nMidIndex = (n - 1) / 2, nRightIndex = n - 1;
  for (int i = 0; i < n; i++) {
    if (i == (n - 1) / 2) {
      for (int j = 0; j < n; j++) nSumm += arr[i][j];
    } else {
      nSumm += arr[i][nLeftIndex] + arr[i][nRightIndex] + arr[i][nMidIndex];
    }
    nLeftIndex++;
    nRightIndex--;
  }
  cout << nSumm;
  for (int i = 0; i < n; i++) {
    delete[] arr[i];
  }
  delete[] arr;
  return 0;
}
