===INPUT=== 10 1 3 8 7 9 5 4 7 7 4 ===OUTPUT=== 18 ===END===