P12199 [AOJ] Sightseeing Tour
普及
题目描述

Example

Input

3
0 2 7
2 0 4
5 8 0

Output

11

输入格式

见题面

输出格式

见题面

样例输入
3 0 2 7 2 0 4 5 8 0
样例输出
11