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 = list(c.keys()) print(cc[1]) else: cc = list(c.keys()) print(cc[0])