






'''simple docstring'''
import random





def        _a(     UpperCamelCase__ :  Tuple,		UpperCamelCase__ :  str,		UpperCamelCase__ :  Optional[int]							):




      '''simple docstring'''






      SCREAMING_SNAKE_CASE__   : Optional[int]													=a[left_index]
      SCREAMING_SNAKE_CASE__   : Union[str, Any]													=left_index + 1
      for j in range(left_index + 1,		A__							):
            if a[j] < pivot:
                  SCREAMING_SNAKE_CASE__						,		SCREAMING_SNAKE_CASE__   : List[str]													=a[i], a[j]
                  i += 1
      SCREAMING_SNAKE_CASE__						,		SCREAMING_SNAKE_CASE__   : Optional[Any]													=a[i - 1], a[left_index]
      return i - 1





def        _a(     UpperCamelCase__ :  List[Any],		UpperCamelCase__ :  str,		UpperCamelCase__ :  str							):




      '''simple docstring'''






      if left < right:
            SCREAMING_SNAKE_CASE__   : Union[str, Any]													=random.randint(A__,		right - 1							)
            SCREAMING_SNAKE_CASE__						,		SCREAMING_SNAKE_CASE__   : Optional[int]													=(
                a[left],
                a[pivot],
            )  # switches the pivot with the left most bound
            SCREAMING_SNAKE_CASE__   : Dict													=partition(A__,		A__,		A__							)
            quick_sort_random(
                A__,		A__,		A__							)  # recursive quicksort to the left of the pivot point
            quick_sort_random(
                A__,		pivot_index + 1,		A__							)  # recursive quicksort to the right of the pivot point





def        _a(     ):




      '''simple docstring'''






      SCREAMING_SNAKE_CASE__   : Tuple													=input('''Enter numbers separated by a comma:\n'''							).strip()
      SCREAMING_SNAKE_CASE__   : int													=[int(A__							) for item in user_input.split(''','''							)]

      quick_sort_random(A__,		0,		len(A__							)							)

      print(A__							)


if __name__ == "__main__":
  main()


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


