#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  long long int s = 0, x = (n + 1) / 2;
  long long int a[n + 1][n + 1];
  for (long long int i = 1; i < n + 1; i++) {
    for (long long int j = 1; j < n + 1; j++) cin >> a[i][j];
  }
  for (long long int i = 1; i < n + 1; i++) {
    for (long long int j = 1; j < n + 1; j++) {
      if (i == j) s = s + a[i][j];
    }
  }
  for (long long int i = 1; i < n + 1; i++) s = s + a[i][x];
  for (long long int i = 1; i < n + 1; i++) s = s + a[x][i];
  for (long long int i = 1, j = n; i < n + 1; i++, j--) s = s + a[i][j];
  s = s - (3 * a[x][x]);
  cout << s;
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  long long int t = 1;
  while (t--) solve();
  return 0;
}
