

import math





class  __lowerCAmelCase     :




  def __init__(				self							,   lowerCAmelCase=0					)  -> str:  # a graph with Node 0,1,...,N-1
        '''simple docstring'''






        _lowercase	       =n
        _lowercase	       =[
            [math.inf for j in range(0							,   lowerCAmelCase					)] for i in range(0							,   lowerCAmelCase					)
        ]  # adjacency matrix for weight
        _lowercase	       =[
            [math.inf for j in range(0							,   lowerCAmelCase					)] for i in range(0							,   lowerCAmelCase					)
        ]  # dp[i][j] stores minimum distance from i to j




  def   A__     (				self							,   lowerCAmelCase							,   lowerCAmelCase							,   lowerCAmelCase					)  -> List[str]:
        '''simple docstring'''






        _lowercase	       =w




  def   A__     (				self					)  -> Optional[int]:
        '''simple docstring'''






        for k in range(0							,   self.n					):
              for i in range(0							,   self.n					):
                    for j in range(0							,   self.n					):
                          _lowercase	       =min(self.dp[i][j]							,   self.dp[i][k] + self.dp[k][j]					)




  def   A__     (				self							,   lowerCAmelCase							,   lowerCAmelCase					)  -> Union[str, Any]:
        '''simple docstring'''






        return self.dp[u][v]


if __name__ == "__main__":
  lowercase_									=   Graph(5)
  graph.add_edge(0, 2, 9)
  graph.add_edge(0, 4, 1_0)
  graph.add_edge(1, 3, 5)
  graph.add_edge(2, 3, 7)
  graph.add_edge(3, 0, 1_0)
  graph.add_edge(3, 1, 2)
  graph.add_edge(3, 2, 1)
  graph.add_edge(3, 4, 6)
  graph.add_edge(4, 1, 3)
  graph.add_edge(4, 2, 4)
  graph.add_edge(4, 3, 9)
  graph.floyd_warshall()
  graph.show_min(1, 4)
  graph.show_min(0, 3)





def      a      (			A__	:   int = 1000000     )    ->      int:





      """simple docstring"""



      _lowercase	       =1
      _lowercase	       =1
      _lowercase	       ={1: 1}

      for inputa in range(2      ,   A__     ):
            _lowercase	       =0
            _lowercase	       =inputa

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

            if inputa not in counters:
                  _lowercase	       =counter

            if counter > pre_counter:
                  _lowercase	       =inputa
                  _lowercase	       =counter
      return largest_number


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


