#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int a;
  int n;
  cin >> n;
  int sum = 0;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      cin >> a;
      if (i == j || i == n / 2 || j == n / 2 || n - 1 - i == j) sum += a;
    }
  cout << sum;
  return 0;
}
