x, y, z = map(int, input().split()) a = min(x, y) b = abs(x - y) if b >= z: print(a + z) else: print(a + b + (z - b) // 2)