#include <bits/stdc++.h>
unsigned row[101];
int main() {
  unsigned n, s = 0;
  std::cin >> n;
  for (unsigned i = 0; i < n; ++i) {
    for (unsigned j = 0; j < n; ++j) std::cin >> row[j];
    if (i == n / 2) {
      s += std::accumulate(std::begin(row), std::begin(row) + n, 0);
    } else {
      s += row[i] + row[n / 2] + row[n - i - 1];
    }
  }
  std::cout << s;
}
