x,y,z = map(int,input().split()) if abs(x-y) >= z: print(min(x,y) + z) else: print(min(x,y) + abs(x-y) + (z - abs(x-y))// 2)