#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long array[n][n], summ = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> array[i][j];
  for (int i = 0; i < n; i++) {
    int j = i;
    summ += array[i][j];
  }
  int j = n;
  for (int i = 0; i < n; i++) {
    j--;
    if (j != i) summ += array[j][i];
  }
  j = 0;
  for (int i = 0; i < n; i++) {
    j = (n - 1) / 2;
    if (j != i) summ += array[i][j];
  }
  for (int i = 0; i < n; i++) {
    j = (n - 1) / 2;
    if (j != i) summ += array[j][i];
  }
  cout << summ;
  return 0;
}
