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