ls = sorted(list(map(int,input().split()))) bools = [false for i in range(4)] for i in ls: bools[i] = true lg = bools.count(true) if lg==1: print(ls[0]) elif lg==2: if ls[0]==ls[1]: print(ls[2]) else: print(ls[0]) else: print(bools.index(false))