

'''simple docstring'''






class     lowercase_			:




  """simple docstring"""




  def __init__(   self     :  Any    ):
   __lowercase													=				0
   __lowercase													=				0
   __lowercase													=				{}






  def       SCREAMING_SNAKE_CASE   (   self     :  Tuple      ,lowercase__     :  List[Any]    ):
   if vertex not in self.adjacency:
    __lowercase													=				{}
    self.num_vertices += 1






  def       SCREAMING_SNAKE_CASE   (   self     :  Union[str, Any]      ,lowercase__     :  Dict      ,lowercase__     :  Union[str, Any]      ,lowercase__     :  Any    ):
   self.add_vertex(lowercase__    )
   self.add_vertex(lowercase__    )

   if head == tail:
    return

   __lowercase													=				weight
   __lowercase													=				weight






  def       SCREAMING_SNAKE_CASE   (   self     :  Union[str, Any]    ):
   __lowercase													=				self.get_edges()
   for edge in edges:
    __lowercase						,			__lowercase						,			__lowercase													=				edge
    edges.remove((tail, head, weight)    )
   for i in range(len(lowercase__    )    ):
    __lowercase													=				list(edges[i]    )

   edges.sort(key=lambda lowercase__    : e[2]    )
   for i in range(len(lowercase__    ) - 1    ):
    if edges[i][2] >= edges[i + 1][2]:
     __lowercase													=				edges[i][2] + 1
   for edge in edges:
    __lowercase						,			__lowercase						,			__lowercase													=				edge
    __lowercase													=				weight
    __lowercase													=				weight






  def __str__(   self     :  Tuple    ):
   __lowercase													=				''''''
   for tail in self.adjacency:
    for head in self.adjacency[tail]:
     __lowercase													=				self.adjacency[head][tail]
     string += F"{head} -> {tail} == {weight}\n"
   return string.rstrip('''\n'''    )






  def       SCREAMING_SNAKE_CASE   (   self     :  Tuple    ):
   __lowercase													=				[]
   for tail in self.adjacency:
    for head in self.adjacency[tail]:
     output.append((tail, head, self.adjacency[head][tail])    )
   return output






  def       SCREAMING_SNAKE_CASE   (   self     :  Optional[Any]    ):
   return self.adjacency.keys()






  @staticmethod
  def       SCREAMING_SNAKE_CASE   (   lowercase__     :  Any=None      ,lowercase__     :  List[str]=None    ):
   __lowercase													=				Graph()
   if vertices is None:
    __lowercase													=				[]
   if edges is None:
    __lowercase													=				[]
   for vertex in vertices:
    g.add_vertex(lowercase__    )
   for edge in edges:
    g.add_edge(*lowercase__    )
   return g






  class     lowercase_			:




    """simple docstring"""




    def __init__(   self     :  Tuple    ):
     __lowercase													=				{}
     __lowercase													=				{}






    def __len__(   self     :  Dict    ):
     return len(self.parent    )






    def       SCREAMING_SNAKE_CASE   (   self     :  int      ,lowercase__     :  str    ):
     if item in self.parent:
      return self.find(lowercase__    )

     __lowercase													=				item
     __lowercase													=				0
     return item






    def       SCREAMING_SNAKE_CASE   (   self     :  List[str]      ,lowercase__     :  int    ):
     if item not in self.parent:
      return self.make_set(lowercase__    )
     if item != self.parent[item]:
      __lowercase													=				self.find(self.parent[item]    )
     return self.parent[item]






    def       SCREAMING_SNAKE_CASE   (   self     :  Union[str, Any]      ,lowercase__     :  List[str]      ,lowercase__     :  Optional[int]    ):
     __lowercase													=				self.find(lowercase__    )
     __lowercase													=				self.find(lowercase__    )

     if roota == roota:
      return roota

     if self.rank[roota] > self.rank[roota]:
      __lowercase													=				roota
      return roota

     if self.rank[roota] < self.rank[roota]:
      __lowercase													=				roota
      return roota

     if self.rank[roota] == self.rank[roota]:
      self.rank[roota] += 1
      __lowercase													=				roota
      return roota
     return None






  @staticmethod
  def       SCREAMING_SNAKE_CASE   (   lowercase__     :  Optional[Any]    ):
   __lowercase													=				graph.num_vertices

   __lowercase													=				Graph.UnionFind()
   __lowercase													=				[]
   while num_components > 1:
    __lowercase													=				{}
    for vertex in graph.get_vertices():
     __lowercase													=				-1

    __lowercase													=				graph.get_edges()
    for edge in edges:
     __lowercase						,			__lowercase						,			__lowercase													=				edge
     edges.remove((tail, head, weight)    )
    for edge in edges:
     __lowercase						,			__lowercase						,			__lowercase													=				edge
     __lowercase													=				union_find.find(lowercase__    )
     __lowercase													=				union_find.find(lowercase__    )
     if seta != seta:
      if cheap_edge[seta] == -1 or cheap_edge[seta][2] > weight:
       __lowercase													=				[head, tail, weight]

      if cheap_edge[seta] == -1 or cheap_edge[seta][2] > weight:
       __lowercase													=				[head, tail, weight]
    for vertex in cheap_edge:
     if cheap_edge[vertex] != -1:
      __lowercase						,			__lowercase						,			__lowercase													=				cheap_edge[vertex]
      if union_find.find(lowercase__    ) != union_find.find(lowercase__    ):
       union_find.union(lowercase__      ,lowercase__    )
       mst_edges.append(cheap_edge[vertex]    )
       __lowercase													=				num_components - 1
   __lowercase													=				Graph.build(edges=lowercase__    )
   return mst




'''simple docstring'''






def 	_A  (					A__ = 1000000   ):






 """simple docstring"""



 __lowercase													=				set(range(3  ,       A__  ,       2   )   )
 primes.add(2   )
 for p in range(3  ,       A__  ,       2   ):
  if p not in primes:
   continue
  primes.difference_update(set(range(p * p  ,       A__  ,       A__   )   )   )

 __lowercase													=				[float(A__   ) for n in range(limit + 1   )]

 for p in primes:
  for n in range(A__  ,       limit + 1  ,       A__   ):
   phi[n] *= 1 - 1 / p

 return int(sum(phi[2:]   )   )


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

