x, y, z = map(int, input().split()) ans = 0 for i in range(z+1): x_ = x+i y_ = y+z-i ans = max(ans, min(x_, y_)) print(ans)