b = [int(x) for x in input().split()] res = 10 for i, v in enumerate(b): if i + 1 != v: res = i + 1 break print(res)