```python
def fit_budget(prices: list, budget: int) -> int:
    if budget < 0:
        raise ValueError("Budget cannot be negative")
    
    prices.sort()
    total_spent = 0
    items_bought = 0
    
    for price in prices:
        if total_spent + price > budget:
            break
        total_spent += price
        items_bought += 1
    
    return items_bought
```