eolymp
bolt
Try our new interface for solving problems
Problems

Weigh-cones

Weigh-cones

One day, Mike brought out of the woods eight cones. He noticed that one of them heavier than others. Now he wants to know what, but all the buds have already been stacked into one pile. Then he offered Masha do it instead using the scales without weights, since Mike was going to watch myself next football match of the Champions League. Masha also like to go on another walk with a mobile phone, so she wants to do the job of Misha as quickly as possible. She quickly realized that at 8 knobble she needed only 2 weigh-in and had gathered for a walk, but then Michael, remembering how he had enough of hardship during the last football match and the car rides, offered her a few more piles, each of which has also been exactly one more severe knobble. Help Masha quickly go for a walk and found in every handful of hard bumps in the minimum number of weighings. \InputFile The input data contain several test cases. Each test case is located on a separate line and contains a single number - the number of shishechek in the next handful of \textbf{n} (\textbf{0} ≤ \textbf{n} ≤ \textbf{2}∙\textbf{10^4}). \OutputFile For each test case in a separate line output the required minimum number of weighings.
Time limit 1 second
Memory limit 64 MiB
Input example #1
0
1
2
8
9
Output example #1
0
0
1
2
2
Source Team Cup Ukraine 2011 - schoolchildren - Round 1