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