






"""simple docstring"""






from __future__ import annotations

from collections.abc import MutableSequence




class 							lowerCAmelCase__				:






      '''simple docstring'''

      def __init__(						self     :  List[str]						,	lowercase_     :  int						,	lowercase_     :  MutableSequence[float]):




          '''simple docstring'''


          if len(lowercase_) != degree + 1:
              raise ValueError(
                  '''The number of coefficients should be equal to the degree + 1.''')

          SCREAMING_SNAKE_CASE_      :  list[float]    						=		list(lowercase_)
          SCREAMING_SNAKE_CASE_      :  str    						=		degree
      def __add__(						self     :  int						,	lowercase_     :  Polynomial):




          '''simple docstring'''


          if self.degree > polynomial_a.degree:
              SCREAMING_SNAKE_CASE_      :  List[str]    						=		self.coefficients[:]
              for i in range(polynomial_a.degree + 1):
                  coefficients[i] += polynomial_a.coefficients[i]
              return Polynomial(self.degree						,	lowercase_)
          else:
              SCREAMING_SNAKE_CASE_      :  int    						=		polynomial_a.coefficients[:]
              for i in range(self.degree + 1):
                  coefficients[i] += self.coefficients[i]
              return Polynomial(polynomial_a.degree						,	lowercase_)
      def __sub__(						self     :  str						,	lowercase_     :  Polynomial):




          '''simple docstring'''


          return self + polynomial_a * Polynomial(0						,	[-1])
      def __neg__(						self     :  str):




          '''simple docstring'''


          return Polynomial(self.degree						,	[-c for c in self.coefficients])
      def __mul__(						self     :  List[Any]						,	lowercase_     :  Polynomial):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  list[float]    						=		[0] * (self.degree + polynomial_a.degree + 1)
          for i in range(self.degree + 1):
              for j in range(polynomial_a.degree + 1):
                  coefficients[i + j] += (
                      self.coefficients[i] * polynomial_a.coefficients[j]
                  )

          return Polynomial(self.degree + polynomial_a.degree						,	lowercase_)
      def _SCREAMING_SNAKE_CASE (						self     :  Tuple						,	lowercase_     :  int | float):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  int | float    						=		0
          for i in range(self.degree + 1):
              result += self.coefficients[i] * (substitution**i)
          return result
      def __str__(						self     :  List[str]):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  List[Any]    						=		''''''
          for i in range(self.degree						,	-1						,	-1):
              if self.coefficients[i] == 0:
                  continue
              elif self.coefficients[i] > 0:
                  if polynomial:
                      polynomial += " + "
              else:
                  polynomial += " - "

              if i == 0:
                  polynomial += str(abs(self.coefficients[i]))
              elif i == 1:
                  polynomial += str(abs(self.coefficients[i])) + "x"
              else:
                  polynomial += str(abs(self.coefficients[i])) + "x^" + str(lowercase_)

          return polynomial
      def __repr__(						self     :  Tuple):




          '''simple docstring'''


          return self.__str__()
      def _SCREAMING_SNAKE_CASE (						self     :  Optional[int]):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  list[float]    						=		[0] * self.degree
          for i in range(self.degree):
              SCREAMING_SNAKE_CASE_      :  Union[str, Any]    						=		self.coefficients[i + 1] * (i + 1)
          return Polynomial(self.degree - 1						,	lowercase_)
      def _SCREAMING_SNAKE_CASE (						self     :  str						,	lowercase_     :  int | float = 0):




          '''simple docstring'''


          SCREAMING_SNAKE_CASE_      :  list[float]    						=		[0] * (self.degree + 2)
          SCREAMING_SNAKE_CASE_      :  Any    						=		constant
          for i in range(self.degree + 1):
              SCREAMING_SNAKE_CASE_      :  Union[str, Any]    						=		self.coefficients[i] / (i + 1)
          return Polynomial(self.degree + 1						,	lowercase_)
      def __eq__(						self     :  str						,	lowercase_     :  object):




          '''simple docstring'''


          if not isinstance(lowercase_						,	lowercase_):
              return False

          if self.degree != polynomial_a.degree:
              return False

          for i in range(self.degree + 1):
              if self.coefficients[i] != polynomial_a.coefficients[i]:
                  return False

          return True



      def __ne__(						self     :  Union[str, Any]						,	lowercase_     :  object):




          '''simple docstring'''


          return not self.__eq__(lowercase_)







"""simple docstring"""
from math import isqrt, loga

def       _snake_case						(						UpperCamelCase						:		int						):
 UpperCAmelCase	:					Any	=	[True] * max_number
 for i in range(2			,		isqrt(max_number - 1						) + 1						):
  if is_prime[i]:
   for j in range(i**2			,		UpperCamelCase			,		UpperCamelCase						):
    UpperCAmelCase	:					str	=	False

 return [i for i in range(2			,		UpperCamelCase						) if is_prime[i]]

def       _snake_case						(						UpperCamelCase						:		int = 800800			,		UpperCamelCase						:		int = 800800						):
 UpperCAmelCase	:					Union[str, Any]	=	degree * loga(UpperCamelCase						)
 UpperCAmelCase	:					int	=	int(UpperCamelCase						)
 UpperCAmelCase	:					Union[str, Any]	=	calculate_prime_numbers(UpperCamelCase						)

 UpperCAmelCase	:					Dict	=	0
 UpperCAmelCase	:					Optional[int]	=	0
 UpperCAmelCase	:					Dict	=	len(UpperCamelCase						) - 1
 while left < right:
  while (
      prime_numbers[right] * loga(prime_numbers[left]						)
      + prime_numbers[left] * loga(prime_numbers[right]						)
      > upper_bound
  ):
   right -= 1
  hybrid_integers_count += right - left
  left += 1

 return hybrid_integers_count


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