#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long arr[n][n];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      cin >> arr[i][j];
    }
  }
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (n == 1 || n == 3)
        sum = sum + arr[i][j];
      else {
        if (i == j) sum = sum + arr[i][j];
        if (j == (n - 1) - i && i != j) sum = sum + arr[i][j];
        if (j == (n / 2) && j != i) sum = sum + arr[i][j];
        if (i == (n / 2) && i != j) sum = sum + arr[i][j];
        if ((i != j) && (i == n / 4) && (j > n / 4) &&
            (j < ((n - 1) - n / 4)) && (j != n / 2))
          sum = sum + arr[i][j];
        if ((i != j) && (i == ((n - 1) - (n / 4))) && (j > n / 4) &&
            (j < ((n - 1) - n / 4)) && (j != n / 2))
          sum = sum + arr[i][j];
        if ((i != j) && (j == n / 4) && (i > n / 4) &&
            (i < ((n - 1) - n / 4)) && (i != n / 2))
          sum = sum + arr[i][j];
        if ((i != j) && (j == ((n - 1) - (n / 4))) && (i > n / 4) &&
            (i < ((n - 1) - n / 4)) && (i != n / 2))
          sum = sum + arr[i][j];
      }
    }
  }
  cout << sum << endl;
  return 0;
}
