

from random import randint, random
def      a      (			A__	:   int      ,   A__	:   int      ,   A__	:   int      ,   A__	:   bool = False      ,   A__	:   bool = False      ,   A__	:   int = 5      ,   )    ->      list:





      """simple docstring"""



      _lowercase	       =[[-1] * number_of_cells]  # Create a highway without any car
      _lowercase	       =0
      _lowercase	       =max(A__      ,   0     )
      while i < number_of_cells:
            _lowercase	       =(
                randint(0      ,   A__     ) if random_speed else initial_speed
            )  # Place the cars
            i += (
                randint(1      ,   max_speed * 2     ) if random_frequency else frequency
            )  # Arbitrary number, may need tuning
      return highway
def      a      (			A__	:   list      ,   A__	:   int     )    ->      int:





      """simple docstring"""



      _lowercase	       =0
      _lowercase	       =highway_now[car_index + 1 :]
      for cell in range(len(A__     )     ):  # May need a better name for this
            if cells[cell] != -1:  # If the cell is not empty then
                  return distance  # we have the distance we wanted
            distance += 1
      # Here if the car is near the end of the highway
      return distance + get_distance(A__      ,   -1     )
def      a      (			A__	:   list      ,   A__	:   float      ,   A__	:   int     )    ->      list:





      """simple docstring"""



      _lowercase	       =len(A__     )
      # Beforce calculations, the highway is empty
      _lowercase	       =[-1] * number_of_cells

      for car_index in range(A__     ):
            if highway_now[car_index] != -1:
                  # Add 1 to the current speed of the car and cap the speed
                  _lowercase	       =min(highway_now[car_index] + 1      ,   A__     )
                  # Number of empty cell before the next car
                  _lowercase	       =get_distance(A__      ,   A__     ) - 1
                  # We can't have the car causing an accident
                  _lowercase	       =min(next_highway[car_index]      ,   A__     )
                  if random() < probability:
                        # Randomly, a driver will slow down
                        _lowercase	       =max(next_highway[car_index] - 1      ,   0     )
      return next_highway
def      a      (			A__	:   list      ,   A__	:   int      ,   A__	:   float      ,   A__	:   int     )    ->      list:





      """simple docstring"""



      _lowercase	       =len(highway[0]     )

      for i in range(A__     ):
            _lowercase	       =update(highway[i]      ,   A__      ,   A__     )
            _lowercase	       =[-1] * number_of_cells

            for car_index in range(A__     ):
                  _lowercase	       =next_speeds_calculated[car_index]
                  if speed != -1:
                        # Change the position based on the speed (with % to create the loop)
                        _lowercase	       =(car_index + speed) % number_of_cells
                        # Commit the change of position
                        _lowercase	       =speed
            highway.append(A__     )

      return highway


if __name__ == "__main__":
  import doctest

  doctest.testmod()





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())))


