#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int summ = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      int current;
      cin >> current;
      if (i == j) {
        summ += current;
      }
      if (i == (n - j - 1)) {
        summ += current;
      }
      if (j == (n - 1) / 2) summ += current;
      if (i == (n - 1) / 2) summ += current;
      if ((i == (n - 1) / 2) && ((j == (n - 1) / 2))) summ -= 3 * current;
    }
  }
  cout << summ;
  return 0;
}
