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