a, b, c = map(int, input().split()) for x in range(4): temp = [a, b, c, x] counts = [0] * 4 for num in temp: counts[num] += 1 # Check condition 1: all same cond1 = any(cnt == 4 for cnt in counts) # Check condition 2: exactly two types each appearing twice freq = {} for cnt in counts: if cnt > 0: freq[cnt] = freq.get(cnt, 0) + 1 cond2 = freq == {2: 2} # Check condition 3: all distinct cond3 = all(cnt <= 1 for cnt in counts) and (sum(counts) == 4) if cond1 or cond2 or cond3: print(x) break