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