3D Printed Statues

With one printer that prints a statue or a new printer each day, find the fewest days to produce at least n statues.

Medium5GreedyMathImplementationBrute forceInterviewNo attempts yetTime limit2sMemory limit512 MB

Problem

You own one 3D printer and need to produce nn statues with it. Printing the statues one at a time takes a long time, so printing a new printer first can be faster. A newly printed printer can print statues or print yet another printer.

Every print job takes one full day. Each day you decide, for every printer you own, whether it prints a statue or prints a new printer. A printer produced on a given day is usable from the next day on, and a printer is never consumed by a job.

Find the minimum number of days needed to print at least nn statues.

Input

The first line contains one integer nn, the number of statues you need (1n100001 \le n \le 10000).

Output

Print one integer on a single line, the minimum number of days needed to print at least nn statues.