Collatz Steps
Start from . If it is even, halve it; if odd, replace it with . Count the steps until you reach 1.
Input
A single integer .
Output
The number of steps.
Constraints
Sample 1
Input
6
Output
8
Sample 2
Input
1
Output
0
Start from . If it is even, halve it; if odd, replace it with . Count the steps until you reach 1.
A single integer .
The number of steps.
Input
6
Output
8
Input
1
Output
0