from math import isqrt




def       _snake_case	(   lowerCAmelCase							:   int	):
		"""simple docstring"""







		SCREAMING_SNAKE_CASE_  :		Optional[int]				      =    [True] * max_number
		for i in range(2   , isqrt(max_number - 1	) + 1	):
				if is_prime[i]:
						for j in range(i**2   , lowerCAmelCase   , lowerCAmelCase	):
								SCREAMING_SNAKE_CASE_  :		Optional[int]				      =    False

		return [i for i in range(2   , lowerCAmelCase	) if is_prime[i]]




def       _snake_case	(   lowerCAmelCase							:   int = 1_0**8	):
		"""simple docstring"""







		SCREAMING_SNAKE_CASE_  :		str				      =    calculate_prime_numbers(max_number // 2	)

		SCREAMING_SNAKE_CASE_  :		Union[str, Any]				      =    0
		SCREAMING_SNAKE_CASE_  :		Union[str, Any]				      =    0
		SCREAMING_SNAKE_CASE_  :		List[Any]				      =    len(lowerCAmelCase	) - 1
		while left <= right:
				while prime_numbers[left] * prime_numbers[right] >= max_number:
						right -= 1
				semiprimes_count += right - left + 1
				left += 1

		return semiprimes_count


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



def      a      (			A__	:   int = 1000000     )    ->      int:





      """simple docstring"""



      _lowercase	       =1
      _lowercase	       =1
      _lowercase	       ={1: 1}

      for inputa in range(2      ,   A__     ):
            _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())))


