{"raw_statement":[{"iden":"problem statement","content":"A sequence $a={a_1,a_2,a_3,......}$ is determined as follows:\n\n*   The first term $s$ is given as input.\n    \n*   Let $f(n)$ be the following function: $f(n) = n/2$ if $n$ is even, and $f(n) = 3n+1$ if $n$ is odd.\n    \n*   $a_i = s$ when $i = 1$, and $a_i = f(a_{i-1})$ when $i > 1$.\n    \n\nFind the minimum integer $m$ that satisfies the following condition:\n\n*   There exists an integer $n$ such that $a_m = a_n (m > n)$."},{"iden":"constraints","content":"*   $1 \\leq s \\leq 100$\n*   All values in input are integers.\n*   It is guaranteed that all elements in $a$ and the minimum $m$ that satisfies the condition are at most $1000000$."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$s$"},{"iden":"sample input 1","content":"8"},{"iden":"sample output 1","content":"5\n\n$a={8,4,2,1,4,2,1,4,2,1,......}$. As $a_5=a_2$, the answer is $5$."},{"iden":"sample input 2","content":"7"},{"iden":"sample output 2","content":"18\n\n$a={7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1,......}$."},{"iden":"sample input 3","content":"54"},{"iden":"sample output 3","content":"114"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}