#C1478. Tournament Rounds

    ID: 44466 Type: Default 1000ms 256MiB

Tournament Rounds

Tournament Rounds

In a single-elimination tournament with \(N\) players, matches are played in rounds until only one champion remains. In each round, players are paired up and the losers are eliminated. When there is an odd number of players, one player gets a bye to the next round.

The number of players advancing to the next round is given by:

\(N_{next} = \left\lceil \frac{N}{2} \right\rceil\)

Your task is to determine the number of rounds required to reduce \(N\) players to a single champion.

inputFormat

The input consists of a single integer (N) ((1 \leq N \leq 10^9)) representing the number of players in the tournament. The input is read from standard input (stdin).

outputFormat

Output a single integer representing the number of rounds needed to determine the champion. The result should be written to standard output (stdout).## sample

16
4

</p>