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