num_l = list(map(int, input().split())) i = 1 while i <= len(num_l): if i != num_l[i-1]: break i += 1 print(i)