l = input().split() n = len(set(l)) if n == 2: l = [x for x in l if l.count(x) == 1] elif n == 3: l = [x for x in "0123" if x not in l] print(l[0])