B=list(map(int,input().split())) B.append(0) for i in range(10): if B[i]!=i+1: print(i+1) break