s=list(map(int,input().split())) t=list(set(s)) if len(t)==1: print(s[0]) exit() if len(t)==2: for x in t: if s.count(x)==1: print(x) exit() if len(t)==3: if 1 not in t: print(1) exit() if 2 not in t: print(2) exit() if 3 not in t: print(3) exit() if 0 not in t: print(0) exit()