#include <iostream>
using namespace std;
int main() {
int n, f,c, s=0;
cin>>n;
int a[n][n];
for(f=0; f<n; f++)
for(c=0; c<n; c++) cin>>a[f][c];
for(f=0; f<n; f++)
for(c=0; c<n; c++)
if((f+c)%n != 0) s=s+a[f][c];
s=s+a[0][0];
cout << s;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgbiwgZixjLCBzPTA7CiAgICBjaW4+Pm47CiAgICBpbnQgYVtuXVtuXTsKICAgIAogICAgZm9yKGY9MDsgZjxuOyBmKyspCiAgICAgICAgZm9yKGM9MDsgYzxuOyBjKyspIGNpbj4+YVtmXVtjXTsKICAgIAogICAgZm9yKGY9MDsgZjxuOyBmKyspCiAgICAgICAgZm9yKGM9MDsgYzxuOyBjKyspCiAgICAgICAgCWlmKChmK2MpJW4gIT0gMCkgcz1zK2FbZl1bY107CiAgICAgICAKICAgIHM9cythWzBdWzBdOwogICAgY291dCA8PCBzOwoJcmV0dXJuIDA7Cn0=