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