X,Y,Z = map(int,input().split(" ")) for i in range(Z): if X < Y: X += 1 elif X >= Y: Y += 1 if X>Y: N = Y else: N = X print(N)