




"""simple docstring"""




def 					a__				(       snake_case__ = 50_00_00_00       )		->      int:
			lowerCamelCase       =      set()
			lowerCamelCase       =      int((limit - 24) ** (1 / 2)       )

			lowerCamelCase       =      set(range(3 ,				prime_square_limit + 1 ,				2       )       )
			primes.add(2       )
			for p in range(3 ,				prime_square_limit + 1 ,				2       ):
						if p not in primes:
									continue
						primes.difference_update(set(range(p * p ,				prime_square_limit + 1 ,				snake_case__       )       )       )

			for primea in primes:
						lowerCamelCase       =      primea * primea
						for primea in primes:
									lowerCamelCase       =      primea * primea * primea
									if square + cube >= limit - 16:
												break
									for primea in primes:
												lowerCamelCase       =      primea * primea * primea * primea
												lowerCamelCase       =      square + cube + tetr
												if total >= limit:
															break
												ret.add(snake_case__       )

			return len(snake_case__       )


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









"""simple docstring"""




def 					a__				(       snake_case__ = 1_00_00_00       )		->      int:
			lowerCamelCase       =      1
			lowerCamelCase       =      1
			lowerCamelCase       =      {1: 1}

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



