output_description: Print the minimum integer m that satisfies the condition.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      s
attempt: s = int(input())
  
  def func(n):
    if n % 2 == 0:
      return (n/2)
    else:
      return (3n+1)
  
  a = list()
  a.append(s)
  for i in range(1000):
    a.append(func(a[i]))
  for j in range(1001):
    for k in range(1001):
      if (j != k and a[j] == a[k]):
        print(k)
        exit()
        
problem_description: Statement
  
  A sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:
  
    * The first term s is given as input.
  
    * Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.
  
    * a_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.
  
  Find the minimum integer m that satisfies the following condition:
  
    * There exists an integer n such that a_m = a_n (m > n).
samples: [{"input": "8", "output": "5\n    \n\na=\\\\{8,4,2,1,4,2,1,4,2,1,......\\\\}. As a_5=a_2, the answer is 5.\n\n* * *"}, {"input": "7", "output": "18\n    \n\na=\\\\{7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1,......\\\\}.\n\n* * *"}, {"input": "54", "output": "114"}]