#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n][n], p = 0, g = n - 1, sum = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> a[i][j];
  for (int i = 0; i < n; i++) {
    if (i != g) {
      sum += a[i][p];
      sum += a[i][g];
      sum += a[i][n / 2];
      sum += a[n / 2][i];
    } else if (i == g)
      sum += a[i][p];
    else if (i != n / 2)
      sum += a[i][n / 2];
    p++;
    g--;
  }
  cout << sum << endl;
  return 0;
}
