



"""simple docstring"""
from __future__ import annotations

__SCREAMING_SNAKE_CASE     :  Any										=					{1: 1}



def 				lowerCAmelCase_(      lowercase_   :							int							)		->				int:
				if n in COLLATZ_SEQUENCE_LENGTHS:
								return COLLATZ_SEQUENCE_LENGTHS[n]
				_lowerCamelCase					     = n // 2 if n % 2 == 0 else 3 * n + 1
				_lowerCamelCase					     = collatz_sequence_length(lowercase_							) + 1
				_lowerCamelCase					     = sequence_length
				return sequence_length



def 				lowerCAmelCase_(      lowercase_   :							int = 1_00_00_00							)		->				int:
				_lowerCamelCase					     = max((collatz_sequence_length(lowercase_							), i) for i in range(1  ,      lowercase_							)							)
				return result[1]


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







from itertools import permutations






def 			lowerCamelCase__	():
     _SCREAMING_SNAKE_CASE				:		Dict  			=							list(map("".join,				permutations("0123456789"		)		)		)
     return result[999999]


if __name__ == "__main__":
       print(solution())