Red, Blue, White = map(int, input().split()) for i in range(White): if min(Red, Blue) == Blue: Blue = Blue + 1 else: Red = Red + 1 result = min(Red, Blue) print(result)