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