
'''simple docstring'''
from __future__ import annotations

from collections.abc import Iterator
from typing import Generic, TypeVar

lowerCAmelCase					:    Optional[int]           = TypeVar('T')


class 			SCREAMING_SNAKE_CASE__      (     Generic[T]):







				def __init__(       self						,				A_     )->		Dict:







											'''simple docstring'''






											UpperCamelCase   			=     data
											UpperCamelCase   			=     None







				def __str__(       self     )->		str:







											'''simple docstring'''






											return F'''{self.data}'''


class 			SCREAMING_SNAKE_CASE__      (     Generic[T]):







				def __init__(       self     )->		None:







											'''simple docstring'''






											UpperCamelCase   			=     None







				def __iter__(       self     )->		Iterator[T]:







											'''simple docstring'''






											UpperCamelCase   			=     self.top
											while node:
																		yield node.data
																		UpperCamelCase   			=     node.next







				def __str__(       self     )->		str:







											'''simple docstring'''






											return "->".join([str(A_     ) for item in self]     )







				def __len__(       self     )->		int:







											'''simple docstring'''






											return len(tuple(iter(self     )     )     )







				def 						UpperCAmelCase_    (       self     )->		bool:







											'''simple docstring'''






											return self.top is None







				def 						UpperCAmelCase_    (       self						,				A_     )->		None:







											'''simple docstring'''






											UpperCamelCase   			=     Node(A_     )
											if not self.is_empty():
																		UpperCamelCase   			=     self.top
											UpperCamelCase   			=     node







				def 						UpperCAmelCase_    (       self     )->		T:







											'''simple docstring'''






											if self.is_empty():
																		raise IndexError('pop from empty stack'     )
											assert isinstance(self.top						,				A_     )
											UpperCamelCase   			=     self.top
											UpperCamelCase   			=     self.top.next
											return pop_node.data







				def 						UpperCAmelCase_    (       self     )->		T:







											'''simple docstring'''






											if self.is_empty():
																		raise IndexError('peek from empty stack'     )

											assert self.top is not None
											return self.top.data







				def 						UpperCAmelCase_    (       self     )->		None:







											'''simple docstring'''






											UpperCamelCase   			=     None


if __name__ == "__main__":
						from doctest import testmod

						testmod()










"""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() = }""")



