def 							UpperCAmelCase		(       lowercase = 1000000				):







				"""simple docstring"""



				__lowercase					     =				1
				__lowercase					     =				1
				__lowercase					     =				{1: 1}

				for inputa in range(2				,     lowercase				):
								__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())))
import unittest

from accelerate import debug_launcher
from accelerate.test_utils import require_cpu, test_ops, test_script




@require_cpu
class   _UpperCamelCase (		unittest.TestCase					):


			"""simple docstring"""






			def 			_SCREAMING_SNAKE_CASE     (  self		)	->   int:

							'''simple docstring'''


							debug_launcher(test_script.main		)





			def 			_SCREAMING_SNAKE_CASE     (  self		)	->   Union[str, Any]:

							'''simple docstring'''


							debug_launcher(test_ops.main		)