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