def solve(): x, y, z = map(int, input().split()) if x > y: x, y = y, x if y - x > z: return x + z return (z - (y - x)) // 2 + y print(solve())