X, Y, Z = map(int, input().split()) while Z > 0: if X < Y: X += 1 else: Y += 1 Z -= 1 print(min(X, Y))