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