def how_many_can_list(num_market_listings: int, number_to_sell: int, num_in_inventory: int) -> int:
    """
    How many items I can actually list on market to have number_to_sell on sale
    :param num_market_listings: Number of own listing on market.
    :param number_to_sell: Max number on sale
    :param num_in_inventory: Number in inventory
    :return: number that can be listed
    """
    if number_to_sell > num_market_listings:
        toList = number_to_sell - num_market_listings
        return min(toList, num_in_inventory)
    elif number_to_sell == num_market_listings or number_to_sell < num_market_listings:
        return 0
    return 0