#include <bits/stdc++.h>
using namespace std;
long long int M = 1000000007;
int main() {
  int n;
  cin >> n;
  int a[n][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    ans += a[i][i];
    ans += a[i][n - i - 1];
    ans += a[(n - 1) / 2][i];
    ans += a[i][(n - 1) / 2];
  }
  ans -= 3 * (a[(n - 1) / 2][(n - 1) / 2]);
  cout << ans;
  return 0;
}
