




class 		UpperCamelCase__	:

    '''simple docstring'''



    def __init__(    self     ,  UpperCamelCase__     )     ->      None:
           lowerCamelCase   :      int			 =					set_counts
           lowerCamelCase   :      Any			 =					max(UpperCamelCase__     )
           lowerCamelCase   :      str			 =					len(UpperCamelCase__     )
           lowerCamelCase   :      List[str]			 =					[1] * num_sets
           lowerCamelCase   :      Any			 =					list(range(UpperCamelCase__     )     )







    def     _lowercase     (    self     ,  UpperCamelCase__     ,  UpperCamelCase__     )     ->      bool:
           lowerCamelCase   :      Optional[Any]			 =					self.get_parent(UpperCamelCase__     )
           lowerCamelCase   :      Union[str, Any]			 =					self.get_parent(UpperCamelCase__     )

           if src_parent == dst_parent:
                  return False

           if self.ranks[dst_parent] >= self.ranks[src_parent]:
                  self.set_counts[dst_parent] += self.set_counts[src_parent]
                  lowerCamelCase   :      Optional[int]			 =					0
                  lowerCamelCase   :      str			 =					dst_parent
                  if self.ranks[dst_parent] == self.ranks[src_parent]:
                         self.ranks[dst_parent] += 1
                  lowerCamelCase   :      Dict			 =					self.set_counts[dst_parent]
           else:
                  self.set_counts[src_parent] += self.set_counts[dst_parent]
                  lowerCamelCase   :      int			 =					0
                  lowerCamelCase   :      Dict			 =					src_parent
                  lowerCamelCase   :      Tuple			 =					self.set_counts[src_parent]

           lowerCamelCase   :      int			 =					max(self.max_set     ,  UpperCamelCase__     )
           return True







    def     _lowercase     (    self     ,  UpperCamelCase__     )     ->      int:
           if self.parents[disj_set] == disj_set:
                  return disj_set
           lowerCamelCase   :      Optional[Any]			 =					self.get_parent(self.parents[disj_set]     )
           return self.parents[disj_set]












def      A      (      _SCREAMING_SNAKE_CASE = 100_0000    )	-> int:
       lowerCamelCase   :      Tuple			 =					1
       lowerCamelCase   :      int			 =					1
       lowerCamelCase   :      Optional[Any]			 =					{1: 1}

       for inputa in range(2 ,_SCREAMING_SNAKE_CASE    ):
              lowerCamelCase   :      Union[str, Any]			 =					0
              lowerCamelCase   :      List[str]			 =					inputa

              while True:
                     if number in counters:
                            counter += counters[number]
                            break
                     if number % 2 == 0:
                            number //= 2
                            counter += 1
                     else:
                            lowerCamelCase   :      str			 =					(3 * number) + 1
                            counter += 1

              if inputa not in counters:
                     lowerCamelCase   :      str			 =					counter

              if counter > pre_counter:
                     lowerCamelCase   :      str			 =					inputa
                     lowerCamelCase   :      Any			 =					counter
       return largest_number


if __name__ == "__main__":
       print(solution(int(input().strip())))






