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