See Problem N for PDF statements.
NIO is playing a new game. In this game, NIO has a sword with attack power represented by an integer

. Initially,

. There are also

enemies in the game. NIO has to kill them in order, which means NIO must kill the
)
-th enemy before killing the

-th enemy for each

(

). For the

-th enemy, NIO can kill it if and only if

.
Fortunately, NIO can upgrade his sword at any moment for any number of times. Each time NIO upgrades his sword, he first chooses an integer

(

), then changes the attack power of the sword from

to

.
NIO wants to minimize the number of times to upgrade the sword so that he can win the game as fast as possible. Can you help him to find the minimum times?