#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  int a[n][n];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) std::cin >> a[i][j];
  int sum = 0;
  int l = (n - 1) / 2, j = n - 1;
  for (int i = 0; i < n; i++) {
    sum = sum + a[i][l] + a[l][i] + a[i][i] + a[i][j--];
  }
  sum = sum - 3 * a[l][l];
  std::cout << sum;
}
