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