def number_players_search(weights, players, quota):
    """
    Count the quantity of players before they pass the quota.

    Parameters
    ----------
    weight  : list 
                Vector with the weights of each player.
    players : dictionary
                Name of the the players and their weights.
    quota   : int
                Necesary weight to win the game.

    Returns
    -------
    int
        Quantity of players.

    """
    total_power = 0
    number_players = 0
    for player in weights:
        total_power += players[player]
        number_players += 1
        if total_power >= quota:
            return number_players
