a=[int(i) for i in input().split()] for i in range(10): if i+1!=a[i]: print(i+1) break