#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  int arr[n + 1][n + 1];
  int counter = 0;
  int res = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; ++j) {
      cin >> arr[i][j];
      if (j == i || j == (n + 1) / 2 || j == n - i + 1 || i == (n + 1) / 2)
        counter += arr[i][j];
    }
  cout << counter;
  return 0;
}
