b = list(map(int, input().split())) ans = 0 for i, e in enumerate(b, 1): if i != e: ans = i break print(ans)