X,Y,Z = map(int,input().split()) RB = [X,Y] RB = sorted(RB) while RB[0] != RB[1]: if Z > 0: RB[0] += 1 Z -= 1 else: break ans = RB[0] + Z//2 print(ans)