x, y, z = map(int, input().split()) while z > 0: if x > y: y += 1 else: x += 1 z -= 1 if x > y: print(y) elif y > x: print(x) else: print(x)