




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

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

A				: Tuple					      =			TypeVar("""T""", bound=bool)






class 			SCREAMING_SNAKE_CASE(							Generic[T]	):

       def __init__(       self   ,						lowerCamelCase__	)       ->   None:

           """simple docstring"""



           __lowercase     							=		value
           __lowercase     							=		None
           __lowercase     							=		None

       @property
       def        snake_case__     (       self	)       ->   T:

           """simple docstring"""



           return self._value




       @staticmethod
       def        snake_case__     (       lowerCamelCase__   ,						lowerCamelCase__	)       ->   SkewNode[T] | None:

           """simple docstring"""



           if not roota:
               return roota

           if not roota:
               return roota

           if roota.value > roota.value:
               __lowercase							,__lowercase     							=		roota, roota

           __lowercase     							=		roota
           __lowercase     							=		roota.right
           __lowercase     							=		roota.left
           __lowercase     							=		SkewNode.merge(lowerCamelCase__   ,						lowerCamelCase__	)

           return result






class 			SCREAMING_SNAKE_CASE(							Generic[T]	):

       def __init__(       self   ,						lowerCamelCase__ = ()	)       ->   None:

           """simple docstring"""



           __lowercase     							=		None
           if data:
               for item in data:
                   self.insert(lowerCamelCase__	)

       def __bool__(       self	)       ->   bool:

           """simple docstring"""



           return self._root is not None

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

           """simple docstring"""



           __lowercase     							=		[]
           while self:
               result.append(self.pop()	)

           # Pushing items back to the heap not to clear it.
           for item in result:
               self.insert(lowerCamelCase__	)

           return iter(lowerCamelCase__	)

       def        snake_case__     (       self   ,						lowerCamelCase__	)       ->   None:

           """simple docstring"""



           __lowercase     							=		SkewNode.merge(self._root   ,						SkewNode(lowerCamelCase__	)	)

       def        snake_case__     (       self	)       ->   T | None:

           """simple docstring"""



           __lowercase     							=		self.top()
           __lowercase     							=		(
               SkewNode.merge(self._root.left   ,						self._root.right	) if self._root else None
           )

           return result

       def        snake_case__     (       self	)       ->   T:

           """simple docstring"""



           if not self._root:
               raise IndexError("""Can't get top element for the empty heap."""	)
           return self._root.value




       def        snake_case__     (       self	)       ->   None:

           """simple docstring"""



           __lowercase     							=		None


if __name__ == "__main__":
  import doctest

  doctest.testmod()










'''simple docstring'''
from math import gcd
def 							snake_case_    (  a__						:      int = 1_20_00     ):



    """simple docstring"""




    __lowercase     							=		0
    for d in range(max_d + 1     ):
        for n in range(d // 3 + 1       ,(d + 1) // 2     ):
            if gcd(a__       ,a__     ) == 1:
                fractions_number += 1
    return fractions_number


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




