#include <iostream>
using namespace std;
int main() {
int n, suma = 0;
cin >> n;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
int x;
cin >> x;
if ((i + j) % n != 0 || (i != 1 && j != 2) && (i != 2 && j != 1)) {
suma += x;
}
}
}
cout << suma << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBpbnQgbiwgc3VtYSA9IDA7CiAgICBjaW4gPj4gbjsKCiAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgewogICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgbjsgaisrKSB7CiAgICAgICAgICAgIGludCB4OwogICAgICAgICAgICBjaW4gPj4geDsKICAgICAgICAgICAgaWYgKChpICsgaikgJSBuICE9IDAgfHwgKGkgIT0gMSAmJiBqICE9IDIpICYmIChpICE9IDIgJiYgaiAhPSAxKSkgewogICAgICAgICAgICAgICAgc3VtYSArPSB4OwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKICAgIGNvdXQgPDwgc3VtYSA8PCBlbmRsOwogICAgcmV0dXJuIDA7Cn0=