

from __future__ import annotations

from typing import Any


class 				SCREAMING_SNAKE_CASE__ :





    def __init__(				self						,       a):
         lowercase__   :       Optional[Any]				=	num_of_nodes
         lowercase__   :       list[list[int]]				=	[]
         lowercase__   :       dict[int, int]				=	{}





    def 				snake_case_    (				self						,       a						,       a						,       a):
         self.m_edges.append([u_node, v_node, weight])





    def 				snake_case_    (				self						,       a):

         if self.m_component[u_node] == u_node:
              return u_node
         return self.find_component(self.m_component[u_node])





    def 				snake_case_    (				self						,       a):

         if self.m_component[u_node] != u_node:
              for k in self.m_component:
                   lowercase__   :       Tuple				=	self.find_component(a)





    def 				snake_case_    (				self						,       a						,       a						,       a):

         if component_size[u_node] <= component_size[v_node]:
              lowercase__   :       Dict				=	v_node
              component_size[v_node] += component_size[u_node]
              self.set_component(a)

         elif component_size[u_node] >= component_size[v_node]:
              lowercase__   :       List[Any]				=	self.find_component(a)
              component_size[u_node] += component_size[v_node]
              self.set_component(a)





    def 				snake_case_    (				self):
         lowercase__   :       str				=	[]
         lowercase__   :       Optional[Any]				=	0

         lowercase__   :       list[Any]				=	[-1] * self.m_num_of_nodes

         # A list of components (initialized to all of the nodes)
         for node in range(self.m_num_of_nodes):
              self.m_component.update({node: node})
              component_size.append(1)

         lowercase__   :       Union[str, Any]				=	self.m_num_of_nodes

         while num_of_components > 1:
              for edge in self.m_edges:
                   lowercase__				,			lowercase__				,			lowercase__   :       Tuple				=	edge

                   lowercase__   :       str				=	self.m_component[u]
                   lowercase__   :       Dict				=	self.m_component[v]

                   if u_component != v_component:

                        for component in (u_component, v_component):
                             if (
                                 minimum_weight_edge[component] == -1
                                 or minimum_weight_edge[component][2] > w
                             ):
                                  lowercase__   :       Any				=	[u, v, w]

              for edge in minimum_weight_edge:
                   if isinstance(a						,       a):
                        lowercase__				,			lowercase__				,			lowercase__   :       List[str]				=	edge

                        lowercase__   :       Tuple				=	self.m_component[u]
                        lowercase__   :       Optional[int]				=	self.m_component[v]

                        if u_component != v_component:
                             mst_weight += w
                             self.union(a						,       a						,       a)
                             print(f"""Added edge [{u} - {v}]\nAdded weight: {w}\n""")
                             num_of_components -= 1

              lowercase__   :       Any				=	[-1] * self.m_num_of_nodes
         print(f"""The total weight of the minimal spanning tree is: {mst_weight}""")



def      snake_case__      (   ):



     '''simple docstring'''







if __name__ == "__main__":
       import doctest

       doctest.testmod()




def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   int = 50_000_000      ):



     '''simple docstring'''





     lowercase__   :       List[Any]				=	set()
     lowercase__   :       Any				=	int((limit - 24) ** (1 / 2)      )

     lowercase__   :       Any				=	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     ,					SCREAMING_SNAKE_CASE_      )      )      )

     for primea in primes:
          lowercase__   :       Any				=	primea * primea
          for primea in primes:
               lowercase__   :       Optional[int]				=	primea * primea * primea
               if square + cube >= limit - 16:
                    break
               for primea in primes:
                    lowercase__   :       Dict				=	primea * primea * primea * primea
                    lowercase__   :       List[Any]				=	square + cube + tetr
                    if total >= limit:
                         break
                    ret.add(SCREAMING_SNAKE_CASE_      )

     return len(SCREAMING_SNAKE_CASE_      )


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

