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