def number_of_matches(num_of_players):
    """Finds out the necessary number of swiss pair rounds.

    Args:
      num_of_players: the number of players in tournament.
    Returns:
      num_of_rounds: necessary number of rounds to find winner.
    """
    num_of_rounds = 0
    while 2**num_of_rounds < num_of_players:
        num_of_rounds += 1
    return num_of_rounds