


'''simple docstring'''



from __future__ import annotations

import sys
from collections import deque
from typing import Generic, TypeVar

__UpperCAmelCase    :Any				       =     TypeVar("T")



class 			a       (	Generic[T] ):


     """simple docstring"""






     SCREAMING_SNAKE_CASE :				deque[T]  # Cache store of keys
     SCREAMING_SNAKE_CASE :				set[T]  # References of the keys in cache
     SCREAMING_SNAKE_CASE :				int							     =     1_0  # Maximum capacity of cache

     def __init__(       self  :	str							,				snake_case  :	int    )		->							None:
          __UpperCAmelCase			:				Tuple													=    deque()
          __UpperCAmelCase			:				Optional[Any]													=    set()
          if not n:
               __UpperCAmelCase			:				Tuple													=    sys.maxsize
          elif n < 0:
               raise ValueError('''n should be an integer greater than 0.'''    )
          else:
               __UpperCAmelCase			:				str													=    n

     def 				lowerCamelCase__				(       self  :	Optional[Any]							,				snake_case  :	T    )		->							None:
          if x not in self.key_reference:
               if len(self.dq_store    ) == LRUCache._MAX_CAPACITY:
                    __UpperCAmelCase			:				Union[str, Any]													=    self.dq_store.pop()
                    self.key_reference.remove(snake_case    )
          else:
               self.dq_store.remove(snake_case    )

          self.dq_store.appendleft(snake_case    )
          self.key_reference.add(snake_case    )

     def 				lowerCamelCase__				(       self  :	List[str]    )		->							None:
          for k in self.dq_store:
               print(snake_case    )






     def __repr__(       self  :	int    )		->							str:
          return f'LRUCache({self._MAX_CAPACITY}) => {list(self.dq_store    )}'


if __name__ == "__main__":
      import doctest

      doctest.testmod()

      __UpperCAmelCase    :LRUCache[str | int]				       =     LRUCache(4)
      lru_cache.refer("A")
      lru_cache.refer(2)
      lru_cache.refer(3)
      lru_cache.refer("A")
      lru_cache.refer(4)
      lru_cache.refer(5)
      lru_cache.display()

      print(lru_cache)
      assert str(lru_cache) == "LRUCache(4) => [5, 4, 'A', 3]"



'''simple docstring'''



def 			_a			(		_lowercase      :			int = 50000000						):





     '''simple docstring'''






     __UpperCAmelCase			:				List[str]													=    set()
     __UpperCAmelCase			:				Tuple													=    int((limit - 24) ** (1 / 2)						)

     __UpperCAmelCase			:				Tuple													=    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    ,      _lowercase						)						)						)

     for primea in primes:
          __UpperCAmelCase			:				Any													=    primea * primea
          for primea in primes:
               __UpperCAmelCase			:				Any													=    primea * primea * primea
               if square + cube >= limit - 16:
                    break
               for primea in primes:
                    __UpperCAmelCase			:				Optional[Any]													=    primea * primea * primea * primea
                    __UpperCAmelCase			:				Union[str, Any]													=    square + cube + tetr
                    if total >= limit:
                         break
                    ret.add(_lowercase						)

     return len(_lowercase						)


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