===INPUT=== 16 2 4 6 1 6 8 7 3 3 5 8 9 1 2 6 4 4 1 5 0 9 1 15 6 10 ===OUTPUT=== 6 ===END===