#ZJ001. [ZJ-001] 冰雹猜想/角谷猜想

[ZJ-001] 冰雹猜想/角谷猜想

Background

The Collatz Conjecture states that:

For any positive integer xx:

  • If it's odd, multiply it by 33 and add 11, i.e.: xx×3+1x \rarr x \times 3 + 1;

  • If it's even, divide it by 22, i.e.: xx2x \rarr \dfrac{x}{2}.

By repeating these operations, the number will eventually reach 11 and fall into the 142141 \rarr 4 \rarr 2 \rarr 1 \rarr 4 \rarr \cdots loop.

Description

Now, write a program to calculate how many operations are needed for a positive integer xx to transform into 11.

Input

A single line containing the positive integer xx to be processed.

Output

A non-negative integer ss, representing the number of operations required.

7
16
8
3

Hint

【Data Scale and Convention】

For 100%100\% of the data, 1x2×1061 \leq x \leq 2 \times 10^6.