#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[100][100];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> arr[i][j];
    }
  }
  if (n == 1)
    cout << arr[0][0];
  else {
    int sum = 0;
    for (int i = 0; i < n; i++) {
      sum += arr[i][i];
      sum += arr[i][n - 1 - i];
    }
    int m = (n - 1) / 2;
    for (int i = 0; i < n; i++) {
      sum += arr[m][i];
      sum += arr[i][m];
    }
    cout << sum - 3 * arr[m][m];
  }
}
