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