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