a, b, c = map(int, input().split()) while c > 0: if a < b: a += 1 else: b += 1 c -= 1 print (min(a, b))