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