x, y, z = map(int, input().split()) # 白をうまく振り分ける while z > 0: if x >= y: y += 1 z -= 1 else: x += 1 z -= 1 print(min(x, y))