X,Y,Z = list(map(int,input().split())) if abs(Y-X)<=Z: print(max(X,Y)+(Z-min(X,Y))//2) else: print(min(X+Z,Y+Z))