X,Y,Z = map(int,input().split()) if Z==0: print(min(X,Y)) else: if X=Z: print(X+Z) else: Z-=(Y-X) print(Y+Z//2) elif X>Y: if X-Y>=Z: print(Y+Z) else: Z-=(X-Y) print(X+Z//2) else: print(X+Z//2)