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