num_l = list(map(int, input().split())) num_l = num_l.append(0) for i in num_l: if i != num_l.index(i) + 1: print(i-1) break