



from __future__ import annotations

from decimal import Decimal
from math import *  # noqa: F403

from sympy import diff






def        A       (      _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase = 10**-10						):





							'''simple docstring'''




							_lowerCAmelCase  :							Any				     =					a
							while True:
														_lowerCAmelCase  :							Dict				     =					Decimal(_lowerCamelCase						) - (
														    Decimal(eval(_lowerCamelCase						)						) / Decimal(eval(str(diff(_lowerCamelCase						)						)						)						)  # noqa: S307
														)
														# This number dictates the accuracy of the answer
														if abs(eval(_lowerCamelCase						)						) < precision:  # noqa: S307
																					return float(_lowerCamelCase						)


# Let's Execute
if __name__ == "__main__":
						# Find root of trigonometric function
						# Find value of pi
						print(f'''The root of sin(x) = 0 is {newton_raphson("sin(x)", 2)}''')
						# Find root of polynomial
						print(f'''The root of x**2 - 5*x + 2 = 0 is {newton_raphson("x**2 - 5*x + 2", 0.4)}''')
						# Find Square Root of 5
						print(f'''The root of log(x) - 1 = 0 is {newton_raphson("log(x) - 1", 2)}''')
						# Exponential Roots
						print(f'''The root of exp(x) - 1 = 0 is {newton_raphson("exp(x) - 1", 0)}''')





def        A       (      _lowerCamelCase = 1_000_000						):





							'''simple docstring'''




							_lowerCAmelCase  :							Any				     =					1
							_lowerCAmelCase  :							Optional[Any]				     =					1
							_lowerCAmelCase  :							List[str]				     =					{1: 1}

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

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

														if inputa not in counters:
																					_lowerCAmelCase  :							Tuple				     =					counter

														if counter > pre_counter:
																					_lowerCAmelCase  :							Union[str, Any]				     =					inputa
																					_lowerCAmelCase  :							Union[str, Any]				     =					counter
							return largest_number


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