Collatz Steps


Submit solution

Points: 100
Time limit: 2.0s
Memory limit: 256M

Author:
Problem types
Allowed languages
C++, Python

Starting from \(n\), repeatedly replace an even value by half of it and an odd value by three times it plus one. Count the steps needed to reach \(1\).

Input

One positive integer \(n\). The process is guaranteed to reach \(1\) within \(10^6\) steps.

The input satisfies:

  • \(1 <= n <= 10^18\)

Output

Print the number of steps.

Example

Input
5
Output
5

Comments

There are no comments at the moment.