x,y,z = map(int,input().split()) tmp = abs(x-y) if z < tmp: if x < y: print(x+z) else: print(y+z) else: z -= tmp ans = max(x,y) ans += z//2 print(ans)