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