




def __UpperCamelCase			(       _A = 600851475143  ):

						try:
												lowerCAmelCase_      			=  int(_A  )
						except (TypeError, ValueError):
												raise TypeError('''Parameter n must be int or castable to int.'''  )
						if n <= 0:
												raise ValueError('''Parameter n must be greater than or equal to one.'''  )
						lowerCAmelCase_      			=  1
						lowerCAmelCase_      			=  2
						while i * i <= n:
												while n % i == 0:
																		lowerCAmelCase_      			=  i
																		n //= i
												i += 1
						if n > 1:
												lowerCAmelCase_      			=  n
						return int(_A  )


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










def __UpperCamelCase			(       _A = 1000000  ):
						lowerCAmelCase_      			=  1
						lowerCAmelCase_      			=  1
						lowerCAmelCase_      			=  {1: 1}

						for inputa in range(2 ,  _A  ):
												lowerCAmelCase_      			=  0
												lowerCAmelCase_      			=  inputa

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

												if inputa not in counters:
																		lowerCAmelCase_      			=  counter

												if counter > pre_counter:
																		lowerCAmelCase_      			=  inputa
																		lowerCAmelCase_      			=  counter
						return largest_number


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




