




from collections.abc import Iterator, MutableMapping
from dataclasses import dataclass
from typing import Generic, TypeVar

UpperCamelCase								=	TypeVar('KEY')
UpperCamelCase								=	TypeVar('VAL')





@dataclass(frozen=UpperCamelCase__      ,							slots=UpperCamelCase__       )
class 					__lowerCamelCase			(       Generic[KEY, VAL]       ):




    """simple docstring"""

    snake_case__   = 42
    snake_case__   = 42






class 					__lowerCamelCase			(       _Item       ):




    """simple docstring"""

    def __init__(			self	:	List[Any]  ) ->			None:
         super().__init__(SCREAMING_SNAKE_CASE__  ,      SCREAMING_SNAKE_CASE__  )


    def __bool__(			self	:	Union[str, Any]  ) ->			bool:
         return False






UpperCamelCase								=	_DeletedItem()





class 					__lowerCamelCase			(       MutableMapping[KEY, VAL]       ):




    """simple docstring"""

    def __init__(			self	:	Tuple  ,      SCREAMING_SNAKE_CASE__	:	int = 8  ,      SCREAMING_SNAKE_CASE__	:	float = 0.75  ) ->			None:
         lowerCAmelCase__            =					initial_block_size
         lowerCAmelCase__            =					[None] * initial_block_size
         assert 0.0 < capacity_factor < 1.0
         lowerCAmelCase__            =					capacity_factor
         lowerCAmelCase__            =					0


    def   a (			self	:	int  ,      SCREAMING_SNAKE_CASE__	:	KEY  ) ->			int:
         return hash(SCREAMING_SNAKE_CASE__  ) % len(self._buckets  )


    def   a (			self	:	List[Any]  ,      SCREAMING_SNAKE_CASE__	:	int  ) ->			int:
         return (ind + 1) % len(self._buckets  )


    def   a (			self	:	List[str]  ,      SCREAMING_SNAKE_CASE__	:	int  ,      SCREAMING_SNAKE_CASE__	:	KEY  ,      SCREAMING_SNAKE_CASE__	:	VAL  ) ->			bool:
         lowerCAmelCase__            =					self._buckets[ind]
         if not stored:
              lowerCAmelCase__            =					_Item(SCREAMING_SNAKE_CASE__  ,      SCREAMING_SNAKE_CASE__  )
              self._len += 1
              return True
         elif stored.key == key:
              lowerCAmelCase__            =					_Item(SCREAMING_SNAKE_CASE__  ,      SCREAMING_SNAKE_CASE__  )
              return True
         else:
              return False


    def   a (			self	:	Optional[int]  ) ->			bool:
         lowerCAmelCase__            =					len(self._buckets  ) * self._capacity_factor
         return len(self  ) >= int(SCREAMING_SNAKE_CASE__  )


    def   a (			self	:	List[str]  ) ->			bool:
         if len(self._buckets  ) <= self._initial_block_size:
              return False
         lowerCAmelCase__            =					len(self._buckets  ) * self._capacity_factor / 2
         return len(self  ) < limit


    def   a (			self	:	Tuple  ,      SCREAMING_SNAKE_CASE__	:	int  ) ->			None:
         lowerCAmelCase__            =					self._buckets
         lowerCAmelCase__            =					[None] * new_size
         lowerCAmelCase__            =					0
         for item in old_buckets:
              if item:
                   self._add_item(item.key  ,      item.val  )


    def   a (			self	:	str  ) ->			None:
         self._resize(len(self._buckets  ) * 2  )


    def   a (			self	:	Union[str, Any]  ) ->			None:
         self._resize(len(self._buckets  ) // 2  )


    def   a (			self	:	Any  ,      SCREAMING_SNAKE_CASE__	:	KEY  ) ->			Iterator[int]:
         lowerCAmelCase__            =					self._get_bucket_index(SCREAMING_SNAKE_CASE__  )
         for _ in range(len(self._buckets  )  ):
              yield ind
              lowerCAmelCase__            =					self._get_next_ind(SCREAMING_SNAKE_CASE__  )


    def   a (			self	:	Optional[Any]  ,      SCREAMING_SNAKE_CASE__	:	KEY  ,      SCREAMING_SNAKE_CASE__	:	VAL  ) ->			None:
         for ind in self._iterate_buckets(SCREAMING_SNAKE_CASE__  ):
              if self._try_set(SCREAMING_SNAKE_CASE__  ,      SCREAMING_SNAKE_CASE__  ,      SCREAMING_SNAKE_CASE__  ):
                   break


    def __setitem__(			self	:	str  ,      SCREAMING_SNAKE_CASE__	:	KEY  ,      SCREAMING_SNAKE_CASE__	:	VAL  ) ->			None:
         if self._is_full():
              self._size_up()

         self._add_item(SCREAMING_SNAKE_CASE__  ,      SCREAMING_SNAKE_CASE__  )


    def __delitem__(			self	:	Any  ,      SCREAMING_SNAKE_CASE__	:	KEY  ) ->			None:
         for ind in self._iterate_buckets(SCREAMING_SNAKE_CASE__  ):
              lowerCAmelCase__            =					self._buckets[ind]
              if item is None:
                   raise KeyError(SCREAMING_SNAKE_CASE__  )
              if item is _deleted:
                   continue
              if item.key == key:
                   lowerCAmelCase__            =					_deleted
                   self._len -= 1
                   break
         if self._is_sparse():
              self._size_down()


    def __getitem__(			self	:	Optional[int]  ,      SCREAMING_SNAKE_CASE__	:	KEY  ) ->			VAL:
         for ind in self._iterate_buckets(SCREAMING_SNAKE_CASE__  ):
              lowerCAmelCase__            =					self._buckets[ind]
              if item is None:
                   break
              if item is _deleted:
                   continue
              if item.key == key:
                   return item.val
         raise KeyError(SCREAMING_SNAKE_CASE__  )


    def __len__(			self	:	List[Any]  ) ->			int:
         return self._len


    def __iter__(			self	:	Optional[int]  ) ->			Iterator[KEY]:
         yield from (item.key for item in self._buckets if item)


    def __repr__(			self	:	Union[str, Any]  ) ->			str:
         lowerCAmelCase__            =					" ,".join(
             f'{item.key}: {item.val}' for item in self._buckets if item  )
         return f'HashMap({val_string})'







"""simple docstring"""



from collections import defaultdict
from math import gcd







def 						__lowercase	(  snake_case_    :    int = 1500000		)  ->int:



    '''simple docstring'''







    __A       :		defaultdict							=	defaultdict(snake_case_		)
    __A       :		Any							=	2
    while 2 * euclid_m * (euclid_m + 1) <= limit:
        for euclid_n in range((euclid_m % 2) + 1							,snake_case_							,2		):
            if gcd(snake_case_							,snake_case_		) > 1:
                continue
            __A       :		List[Any]							=	2 * euclid_m * (euclid_m + euclid_n)
            for perimeter in range(snake_case_							,limit + 1							,snake_case_		):
                frequencies[perimeter] += 1
        euclid_m += 1
    return sum(1 for frequency in frequencies.values() if frequency == 1		)


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




