GCD Guessing Game#3485

GCD Guessing Game

1 second
64 megabytes
Easy

Paul had a birthday yesterday, and they were playing a guessing game there with Andrew: Andrew was trying to guess Paul's age. Andrew knew that Paul's age is an integer between and , inclusive. Andrew can guess any number between and , and Paul will tell him what is the greatest common divisor of and his age.

Here's a possible course of the game for n = 6. Andrew starts with guessing , and Paul replies that the greatest common divisor of and his age is . That means that Paul's age can't be or , but can still be , , or . Andrew continues with guessing , and Paul replies . That means that Paul's age can't be or , and the only two remaining choices are and . Finally, Andrew guesses , and Paul replies . That means that Paul's age is , and the game is over.

Andrew needed three guesses in the above example, but it's possible to always determine Paul's age in at most two guesses for n = 6. The optimal strategy for Andrew is: at the first step, guess . If Paul says , then it's or and he can check which one by guessing . If Paul says , then it's or , and he can check by guessing as we've seen above. If Paul says , then we already know the answer is . Finally, if Paul says , the answer is .

What is the number of guesses required in the worst case if Andrew guesses optimally for the given ?

Input

The input file contains one integer (2 \leq n \leq 10000).

Output

Output one integer — the number of guesses Andrew will need to make in the worst case.

Examples

Example 1

Loading
Loading