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