Game on GCD Queries#8790

Game on GCD Queries

1 second
64 megabytes
Very hard

Chikhman's birthday was yesterday (though not really), and he played a guessing game with Kutsmen: Kutsmen tried to guess Chikhman's age. Kutsmen knows that Chikhman's age is a natural number between and , inclusive. Kutsmen can propose a number x_i, and Chikhman will respond with the greatest common divisor (GCD) of this number and his age.

Let's consider the situation when n = 6. Kutsmen begins by proposing , and Chikhman replies with GCD of . This means that Chikhman's age cannot be or , but could be , , , or . Next, Kutsmen proposes , and Chikhman responds with GCD of . This narrows down Chikhman's possible age to or , excluding and . Finally, Kutsmen proposes , and Chikhman replies with . This confirms that Chikhman's age is . Therefore, Kutsmen required queries.

However, Chikhman's age can actually be determined in just queries. To do this, Kutsmen should first propose . After the response, the age can be determined with at most one more query.

Find the minimal number of queries Kutsmen needs in the worst-case scenario if he acts optimally.

Input

The first line contains a single integer (2 \leq n \leq 10^7) — the maximum possible age of Chikhman.

Output

Output a single integer — the minimal number of queries needed to guess Chikhman's age.

Examples

Example 1

Loading
Loading