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