






"""simple docstring"""

# Lint as: python3

import hashlib
from typing import Union






def _lowerCAmelCase						(	__lowerCamelCase:Union[str, int, bytes] ):

						'''simple docstring'''






						if isinstance(__lowerCamelCase			,    __lowerCamelCase ):
												# Data already in bytes, returns as it as
												return hash_data
						elif isinstance(__lowerCamelCase			,    __lowerCamelCase ):
												# We keep the data as it as for it ot be later encoded to UTF-8
												# However replace `\\` with `/` for Windows compatibility
												__magic_name__      =  hash_data.replace("\\"			,    "/" )
						elif isinstance(__lowerCamelCase			,    __lowerCamelCase ):
												__magic_name__      =  str(__lowerCamelCase )
						else:
												# If data is not of the required type, raise error
												raise InvalidKeyError(__lowerCamelCase )

						return hash_data.encode("utf-8" )

class     A_				(   snake_case_	):







				def __init__(				self				:    Dict    ,     __lowerCamelCase				:    Dict						)					->       Optional[Any]:
										__magic_name__      =  "\nFAILURE TO GENERATE DATASET: Invalid key type detected"
										__magic_name__      =  f'''\nFound Key {hash_data} of type {type(__lowerCamelCase						)}'''
										__magic_name__      =  "\nKeys should be either str, int or bytes type"
										super().__init__(f'''{self.prefix}{self.err_msg}{self.suffix}'''						)





class     A_				(   snake_case_	):







				def __init__(				self				:    List[str]    ,     __lowerCamelCase				:    Tuple    ,     __lowerCamelCase				:    Union[str, Any]    ,     __lowerCamelCase				:    int=""						)					->       List[str]:
										__magic_name__      =  key
										__magic_name__      =  duplicate_key_indices
										__magic_name__      =  fix_msg
										__magic_name__      =  "Found multiple examples generated with the same key"
										if len(__lowerCamelCase						) <= 2_0:
																__magic_name__      =  f'''\nThe examples at index {", ".join(__lowerCamelCase						)} have the key {key}'''
										else:
																__magic_name__      =  f'''\nThe examples at index {", ".join(duplicate_key_indices[:2_0]						)}... ({len(__lowerCamelCase						) - 2_0} more) have the key {key}'''
										__magic_name__      =  "\n" + fix_msg if fix_msg else ""
										super().__init__(f'''{self.prefix}{self.err_msg}{self.suffix}'''						)





class     A_				:







				def __init__(				self				:    Tuple    ,     __lowerCamelCase				:    str						)					->       int:
										__magic_name__      =  hashlib.mda(_as_bytes(__lowerCamelCase						)						)







				def      _snake_case       (				self				:    Dict    ,     __lowerCamelCase				:    Union[str, int, bytes]						)					->       int:
										__magic_name__      =  self._split_mda.copy()
										__magic_name__      =  _as_bytes(__lowerCamelCase						)
										mda.update(__lowerCamelCase						)
										# Convert to integer with hexadecimal conversion
										return int(mda.hexdigest()    ,     1_6						)











"""simple docstring"""

from __future__ import annotations

lowercase           =							{1: 1}






def _lowerCAmelCase						(	__lowerCamelCase:int ):

						'''simple docstring'''






						if n in COLLATZ_SEQUENCE_LENGTHS:
												return COLLATZ_SEQUENCE_LENGTHS[n]
						__magic_name__      =  n // 2 if n % 2 == 0 else 3 * n + 1
						__magic_name__      =  collatz_sequence_length(__lowerCamelCase ) + 1
						__magic_name__      =  sequence_length
						return sequence_length






def _lowerCAmelCase						(	__lowerCamelCase:int = 1_0_0_0_0_0_0 ):

						'''simple docstring'''






						__magic_name__      =  max((collatz_sequence_length(__lowerCamelCase ), i) for i in range(1			,    __lowerCamelCase ) )
						return result[1]


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



