"""simple docstring"""




def 							SCREAMING_SNAKE_CASE     (			_lowerCamelCase						:       int = 1000000	)       ->      int:
  _lowerCAmelCase						:       str  			=     1
  _lowerCAmelCase						:       str  			=     1
  _lowerCAmelCase						:       List[str]  			=     {1: 1}

  for inputa in range(2			,_lowerCamelCase	):
    _lowerCAmelCase						:       str  			=     0
    _lowerCAmelCase						:       int  			=     inputa

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

    if inputa not in counters:
      _lowerCAmelCase						:       Union[str, Any]  			=     counter

    if counter > pre_counter:
      _lowerCAmelCase						:       List[str]  			=     inputa
      _lowerCAmelCase						:       str  			=     counter
  return largest_number


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





"""simple docstring"""




def 							SCREAMING_SNAKE_CASE     (			_lowerCamelCase						:       int = 50	)       ->      int:
  _lowerCAmelCase						:       int  			=     [1] * (length + 1)

  for row_length in range(3			,length + 1	):
    for block_length in range(3			,row_length + 1	):
      for block_start in range(row_length - block_length	):
        ways_number[row_length] += ways_number[
            row_length - block_start - block_length - 1
        ]

      ways_number[row_length] += 1

  return ways_number[length]


if __name__ == "__main__":
     print(F"""{solution() = }""")




