'''simple docstring'''
from math import sqrt







def  _UpperCamelCase (     _a	:	int			):




    """simple docstring"""



    if 1 < number < 4:
        # 2 and 3 are primes
        return True
    elif number < 2 or number % 2 == 0 or number % 3 == 0:
        # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
        return False

    # All primes number are in format of 6k +/- 1
    for i in range(5				,     int(sqrt(_a			) + 1			)				,     6			):
        if number % i == 0 or number % (i + 2) == 0:
            return False
    return True







def  _UpperCamelCase (     _a	:	int = 1_0_0_0_1			):




    """simple docstring"""



    __UpperCamelCase	:	Any		    =  0
    __UpperCamelCase	:	Dict		    =  1
    while count != nth and number < 3:
        number += 1
        if is_prime(_a			):
            count += 1
    while count != nth:
        number += 2
        if is_prime(_a			):
            count += 1
    return number


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




'''simple docstring'''
class 			__lowercase		:







     """simple docstring"""






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







     def lowerCAmelCase     (		self     ,			_lowerCamelCase    ):
         if vertex not in self.adjacency:
             __UpperCamelCase	:	Tuple		    =  {}
             self.num_vertices += 1







     def lowerCAmelCase     (		self     ,			_lowerCamelCase     ,			_lowerCamelCase     ,			_lowerCamelCase    ):
         self.add_vertex(_lowerCamelCase    )
         self.add_vertex(_lowerCamelCase    )

         if head == tail:
             return

         __UpperCamelCase	:	List[Any]		    =  weight
         __UpperCamelCase	:	Optional[int]		    =  weight







     def lowerCAmelCase     (		self    ):
         __UpperCamelCase	:	List[str]		    =  self.get_edges()
         for edge in edges:
             __UpperCamelCase    ,					__UpperCamelCase    ,					__UpperCamelCase	:	Optional[int]		    =  edge
             edges.remove((tail, head, weight)    )
         for i in range(len(_lowerCamelCase    )    ):
             __UpperCamelCase	:	Union[str, Any]		    =  list(edges[i]    )

         edges.sort(key=lambda _lowerCamelCase    : e[2]    )
         for i in range(len(_lowerCamelCase    ) - 1    ):
             if edges[i][2] >= edges[i + 1][2]:
                 __UpperCamelCase	:	Optional[int]		    =  edges[i][2] + 1
         for edge in edges:
             __UpperCamelCase    ,					__UpperCamelCase    ,					__UpperCamelCase	:	Optional[int]		    =  edge
             __UpperCamelCase	:	Tuple		    =  weight
             __UpperCamelCase	:	Optional[Any]		    =  weight







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







     def lowerCAmelCase     (		self    ):
         __UpperCamelCase	:	Any		    =  []
         for tail in self.adjacency:
             for head in self.adjacency[tail]:
                 output.append((tail, head, self.adjacency[head][tail])    )
         return output







     def lowerCAmelCase     (		self    ):
         return self.adjacency.keys()







     @staticmethod
     def lowerCAmelCase     (		_lowerCamelCase=None     ,			_lowerCamelCase=None    ):
         __UpperCamelCase	:	Tuple		    =  Graph()
         if vertices is None:
             __UpperCamelCase	:	List[Any]		    =  []
         if edges is None:
             __UpperCamelCase	:	Optional[int]		    =  []
         for vertex in vertices:
             g.add_vertex(_lowerCamelCase    )
         for edge in edges:
             g.add_edge(*_lowerCamelCase    )
         return g






     class 			__lowercase		:







          """simple docstring"""






          def __init__(		self    ):
              __UpperCamelCase	:	Union[str, Any]		    =  {}
              __UpperCamelCase	:	int		    =  {}







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







          def lowerCAmelCase     (		self     ,			_lowerCamelCase    ):
              if item in self.parent:
                  return self.find(_lowerCamelCase    )

              __UpperCamelCase	:	Optional[Any]		    =  item
              __UpperCamelCase	:	List[str]		    =  0
              return item







          def lowerCAmelCase     (		self     ,			_lowerCamelCase    ):
              if item not in self.parent:
                  return self.make_set(_lowerCamelCase    )
              if item != self.parent[item]:
                  __UpperCamelCase	:	int		    =  self.find(self.parent[item]    )
              return self.parent[item]







          def lowerCAmelCase     (		self     ,			_lowerCamelCase     ,			_lowerCamelCase    ):
              __UpperCamelCase	:	Tuple		    =  self.find(_lowerCamelCase    )
              __UpperCamelCase	:	Any		    =  self.find(_lowerCamelCase    )

              if roota == roota:
                  return roota

              if self.rank[roota] > self.rank[roota]:
                  __UpperCamelCase	:	Dict		    =  roota
                  return roota

              if self.rank[roota] < self.rank[roota]:
                  __UpperCamelCase	:	Optional[Any]		    =  roota
                  return roota

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







     @staticmethod
     def lowerCAmelCase     (		_lowerCamelCase    ):
         __UpperCamelCase	:	int		    =  graph.num_vertices

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

             __UpperCamelCase	:	int		    =  graph.get_edges()
             for edge in edges:
                 __UpperCamelCase    ,					__UpperCamelCase    ,					__UpperCamelCase	:	List[str]		    =  edge
                 edges.remove((tail, head, weight)    )
             for edge in edges:
                 __UpperCamelCase    ,					__UpperCamelCase    ,					__UpperCamelCase	:	Dict		    =  edge
                 __UpperCamelCase	:	List[Any]		    =  union_find.find(_lowerCamelCase    )
                 __UpperCamelCase	:	str		    =  union_find.find(_lowerCamelCase    )
                 if seta != seta:
                     if cheap_edge[seta] == -1 or cheap_edge[seta][2] > weight:
                         __UpperCamelCase	:	str		    =  [head, tail, weight]

                     if cheap_edge[seta] == -1 or cheap_edge[seta][2] > weight:
                         __UpperCamelCase	:	str		    =  [head, tail, weight]
             for vertex in cheap_edge:
                 if cheap_edge[vertex] != -1:
                     __UpperCamelCase    ,					__UpperCamelCase    ,					__UpperCamelCase	:	List[str]		    =  cheap_edge[vertex]
                     if union_find.find(_lowerCamelCase    ) != union_find.find(_lowerCamelCase    ):
                         union_find.union(_lowerCamelCase     ,			_lowerCamelCase    )
                         mst_edges.append(cheap_edge[vertex]    )
                         __UpperCamelCase	:	int		    =  num_components - 1
         __UpperCamelCase	:	Union[str, Any]		    =  Graph.build(edges=_lowerCamelCase    )
         return mst



