The Collatz conjecture, also called the conjecture, states that: Given a starting positive integer , we can eventually obtain after carrying out the following operation repeatedly:
We define as the number of operations needed before becomes .
For example, if we start from , the sequence would be: . Therefore, .
You are asked to write a program to find given a positive integer .