



"""simple docstring"""






from __future__ import annotations

from queue import Queue




class    __snake_case:




    def __init__(   self			):





      '''simple docstring'''



      _SCREAMING_SNAKE_CASE        =			{}




    def   A   (   self			):





      '''simple docstring'''



      for i in self.vertices:
        print(A_    ,							''' : '''    ,							''' -> '''.join([str(A_			) for j in self.vertices[i]]			)			)




    def   A   (   self    ,							A_    ,							A_			):





      '''simple docstring'''



      if from_vertex in self.vertices:
        self.vertices[from_vertex].append(A_			)
      else:
        _SCREAMING_SNAKE_CASE        =			[to_vertex]




    def   A   (   self    ,							A_			):





      '''simple docstring'''



      _SCREAMING_SNAKE_CASE        =			set()

      # create a first in first out queue to store all the vertices for BFS
      _SCREAMING_SNAKE_CASE        =			Queue()

      # mark the source node as visited and enqueue it
      visited.add(A_			)
      queue.put(A_			)

      while not queue.empty():
        _SCREAMING_SNAKE_CASE        =			queue.get()

        # loop through all adjacent vertex and enqueue it if not yet visited
        for adjacent_vertex in self.vertices[vertex]:
          if adjacent_vertex not in visited:
            queue.put(A_			)
            visited.add(A_			)
      return visited


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

    testmod(verbose=True)

    lowerCamelCase				:     Optional[int]								=  Graph()
    g.add_edge(0, 1)
    g.add_edge(0, 2)
    g.add_edge(1, 2)
    g.add_edge(2, 0)
    g.add_edge(2, 3)
    g.add_edge(3, 3)

    g.print_graph()
    # 0  :  1 -> 2
    # 1  :  2
    # 2  :  0 -> 3
    # 3  :  3

    assert sorted(g.bfs(2)) == [0, 1, 2, 3]





"""simple docstring"""






from math import gcd


def 							A__ (     UpperCamelCase__ = 12_000    ):


  '''simple docstring'''


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


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