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