def f(a,b,c): X=[a,b,c] # 4 of a kind for k in range(4): if X.count(k)==3: return k # 2 pair for i in range(4): for j in range(4): if X.count(i)==2 and X.count(j): return j # high card for i in range(4): if X.count(i)==0: return i a,b,c=map(int,input().split()) print(f(a,b,c))