Matrix#214

Matrix

1 second
256 megabytes
Very easy (≈850)

In this problem, an n×n square matrix is given. It is required to find the sum of the elements located in the upper-right part relative to the main diagonal of this matrix. For a 4×4 matrix, the cells located in the upper-right part of the diagonal are shown in green below. The main diagonal itself is shown in red.

Input

The input contains the integer indicating the size of the matrix (1 ≤ 𝑛 ≤ 1000). The next n lines each contain positive integer values a_{i,j} (1 ≤ 𝑎_{𝑖,𝑗} ≤ 1000).

Output

Output the sum of the elements located in the upper-right part of the main diagonal.

Example: 5 + 3 + 10 + 4 + 8 + 20 = 50

Examples

Example 11

Loading
Loading