def f():return list(map(int,input().split())) a=f() if len(set(a))==1: print(a[0]) elif len(set(a))==3: print(6-sum(a)) else: for v in [0,1,2,3]: if a.count(v)==1: print(v)