x, y, z = [int(x) for x in input().split()] if abs(x - y) > z: print(min(x, y) + z) else: print(max(x, y) + (z - abs(x - y)) // 2)