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