Python2でCodeEvalのArray Absordity

input

5;0,1,2,3,0
20;0,1,10,3,2,4,5,7,6,8,11,9,15,12,13,4,16,18,17,14

output

0
4


関連 : Go言語でCodeEvalのArray Absurdity - brainstorm