def operation(a, b, c): res = condition1(a, b, c) if res >= 0: return res res = condition2(a, b, c) if res >= 0: return res res = condition3(a, b, c) if res >= 0: return res def condition1(a, b, c): res = -1 if a == b and a == c: res = a return res def condition2(a, b, c): res = -1 if a == b and a != c: res = c elif a == c and a != b: res = b elif b == c and a != b: res = a return res def condition3(a, b, c): res = -1 if a != b and a != c and b != c: res = abs(a + b + c - 6) return res a, b, c = map(int, input().split()) print(operation(a, b, c))