#include <bits/stdc++.h>
using namespace std;
struct Pair {
  Pair() : row(-1), col(-1) {}
  Pair(int row_, int col_) : row(row_), col(col_) {}
  bool operator<(const Pair& b) const {
    if (row < b.row)
      return true;
    else if (row > b.row)
      return false;
    else
      return col < b.col;
  }
  int row;
  int col;
};
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;
  set<Pair> counted;
  for (int i = 0; i < n; i++) {
    Pair p[4];
    p[0] = Pair(i, i);
    p[1] = Pair(i, n - 1 - i);
    p[2] = Pair((n - 1) / 2, i);
    p[3] = Pair(i, (n - 1) / 2);
    for (int k = 0; k < 4; k++) {
      if (counted.find(p[k]) == counted.end()) {
        ans += a[p[k].row][p[k].col];
        counted.insert(p[k]);
      }
    }
  }
  cout << ans << endl;
  return 0;
}
