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