X, Y, Z = (int(_) for _ in input().split()) while Z >= 0: if X >= Y: Y += 1 else: X += 1 Z -= 1 if X > Y: print(Y) else: print(X)