






'''simple docstring'''



import math



def  __UpperCAmelCase						(					SCREAMING_SNAKE_CASE__:						list,       SCREAMING_SNAKE_CASE__:						int = 0,       SCREAMING_SNAKE_CASE__:						int = 0     )	->      list:

   """simple docstring"""
   __a					  =     end or len(SCREAMING_SNAKE_CASE__     )
   for i in range(SCREAMING_SNAKE_CASE__,       SCREAMING_SNAKE_CASE__     ):
      __a					  =     i
      __a					  =     array[i]
      while temp_index != start and temp_index_value < array[temp_index - 1]:
         __a					  =     array[temp_index - 1]
         temp_index -= 1
      __a					  =     temp_index_value
   return array



def  __UpperCAmelCase						(					SCREAMING_SNAKE_CASE__:						list,       SCREAMING_SNAKE_CASE__:						int,       SCREAMING_SNAKE_CASE__:						int     )	->      None:  # Max Heap

   """simple docstring"""
   __a					  =     index
   __a					  =     2 * index + 1  # Left Node
   __a					  =     2 * index + 2  # Right Node

   if left_index < heap_size and array[largest] < array[left_index]:
      __a					  =     left_index

   if right_index < heap_size and array[largest] < array[right_index]:
      __a					  =     right_index

   if largest != index:
      __a  ,      __a					  =     array[largest], array[index]
      heapify(SCREAMING_SNAKE_CASE__,       SCREAMING_SNAKE_CASE__,       SCREAMING_SNAKE_CASE__     )



def  __UpperCAmelCase						(					SCREAMING_SNAKE_CASE__:						list     )	->      list:

   """simple docstring"""
   __a					  =     len(SCREAMING_SNAKE_CASE__     )

   for i in range(n // 2,       -1,       -1     ):
      heapify(SCREAMING_SNAKE_CASE__,       SCREAMING_SNAKE_CASE__,       SCREAMING_SNAKE_CASE__     )

   for i in range(n - 1,       0,       -1     ):
      __a  ,      __a					  =     array[0], array[i]
      heapify(SCREAMING_SNAKE_CASE__,       0,       SCREAMING_SNAKE_CASE__     )

   return array



def  __UpperCAmelCase						(					SCREAMING_SNAKE_CASE__:						list,       SCREAMING_SNAKE_CASE__:						int,       SCREAMING_SNAKE_CASE__:						int,       SCREAMING_SNAKE_CASE__:						int     )	->      int:

   """simple docstring"""
   if (array[first_index] > array[middle_index]) != (
       array[first_index] > array[last_index]
   ):
      return array[first_index]
   elif (array[middle_index] > array[first_index]) != (
       array[middle_index] > array[last_index]
   ):
      return array[middle_index]
   else:
      return array[last_index]



def  __UpperCAmelCase						(					SCREAMING_SNAKE_CASE__:						list,       SCREAMING_SNAKE_CASE__:						int,       SCREAMING_SNAKE_CASE__:						int,       SCREAMING_SNAKE_CASE__:						int     )	->      int:

   """simple docstring"""
   __a					  =     low
   __a					  =     high
   while True:
      while array[i] < pivot:
         i += 1
      j -= 1
      while pivot < array[j]:
         j -= 1
      if i >= j:
         return i
      __a  ,      __a					  =     array[j], array[i]
      i += 1



def  __UpperCAmelCase						(					SCREAMING_SNAKE_CASE__:						list     )	->      list:

   """simple docstring"""
   if len(SCREAMING_SNAKE_CASE__     ) == 0:
      return array
   __a					  =     2 * math.ceil(math.loga(len(SCREAMING_SNAKE_CASE__     )     )     )
   __a					  =     16
   return intro_sort(SCREAMING_SNAKE_CASE__,       0,       len(SCREAMING_SNAKE_CASE__     ),       SCREAMING_SNAKE_CASE__,       SCREAMING_SNAKE_CASE__     )



def  __UpperCAmelCase						(					SCREAMING_SNAKE_CASE__:						list,       SCREAMING_SNAKE_CASE__:						int,       SCREAMING_SNAKE_CASE__:						int,       SCREAMING_SNAKE_CASE__:						int,       SCREAMING_SNAKE_CASE__:						int     )	->      list:

   """simple docstring"""
   while end - start > size_threshold:
      if max_depth == 0:
         return heap_sort(SCREAMING_SNAKE_CASE__     )
      max_depth -= 1
      __a					  =     median_of_a(SCREAMING_SNAKE_CASE__,       SCREAMING_SNAKE_CASE__,       start + ((end - start) // 2) + 1,       end - 1     )
      __a					  =     partition(SCREAMING_SNAKE_CASE__,       SCREAMING_SNAKE_CASE__,       SCREAMING_SNAKE_CASE__,       SCREAMING_SNAKE_CASE__     )
      intro_sort(SCREAMING_SNAKE_CASE__,       SCREAMING_SNAKE_CASE__,       SCREAMING_SNAKE_CASE__,       SCREAMING_SNAKE_CASE__,       SCREAMING_SNAKE_CASE__     )
      __a					  =     p
   return insertion_sort(SCREAMING_SNAKE_CASE__,       SCREAMING_SNAKE_CASE__,       SCREAMING_SNAKE_CASE__     )


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 __UpperCamelCase   :							Any         =   input("""Enter numbers separated by a comma : """).strip()
 __UpperCamelCase   :							List[Any]         =   [float(item) for item in user_input.split(""",""")]
 print(sort(unsorted))







'''simple docstring'''



from math import isqrt



def  __UpperCAmelCase						(					SCREAMING_SNAKE_CASE__:						int     )	->      bool:

   """simple docstring"""
   return all(number % divisor != 0 for divisor in range(2,       isqrt(SCREAMING_SNAKE_CASE__     ) + 1     )     )



def  __UpperCAmelCase						(					SCREAMING_SNAKE_CASE__:						int = 10**6     )	->      int:

   """simple docstring"""
   __a					  =     0
   __a					  =     1
   __a					  =     7
   while prime_candidate < max_prime:
      primes_count += is_prime(SCREAMING_SNAKE_CASE__     )

      cube_index += 1
      prime_candidate += 6 * cube_index

   return primes_count


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