from collections import Counter a = list(map(int,input().split())) x = Counter(a) if len(x) == 1: print(a[0]) elif len(x) == 2: for i in x: if x[i] == 1: print(i) else: for i in range(4): if i not in a: print(i)