from collections import Counter lst = [int(i) for i in input().strip().split(' ')] c = Counter(lst) if len(c) == 3: for i in range(4): if not(i in lst): print(i) exit(0) elif len(c) == 2: cc = [i[0] for i in c.items() if i[1] == 1][0] print(cc) else: cc = list(c.keys()) print(cc[0])