Total Triangles

Find the best scoring path through the triangle.

Run 2

Input

11
66 71
52 32 83
59 69 23 17
79 33 96 18 59

Expected Output

294