Sum the elements on both diagonals of a square matrix. If the matrix has an odd size, the centre element lies on both diagonals — count it only once.
Input
Line 1: an integer n.
The next n lines each contain n integers (the matrix rows).
Output
The sum of the primary diagonal plus the secondary diagonal, counting the centre once.