x, y, z = map(int, input().split()) if abs(x- y) <= z: print((x+y+z)//2) else: print(min(x, y) + z)