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