#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0;
  cin >> n;
  if (n == 1)
    cin >> sum;
  else if (n == 3) {
    for (int i = 0; i < 9; i++) {
      int t;
      cin >> t;
      sum += t;
    }
  } else if (n == 5) {
    for (int i = 0; i < 25; i++) {
      int t;
      cin >> t;
      if (i != 1 and i != 3 and i != 5 and i != 9 and i != 15 and i != 21 and
          i != 23 and i != 19)
        sum += t;
    }
  }
  cout << sum;
}
