def solve():
    x, y, d = map(int, raw_input().split())

    k = x + y - d
    if k < 0:
        return 0

    return 1 + min(x, y, k, d)


if __name__ == '__main__':
    print solve()