


from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt




def       a_ (       SCREAMING_SNAKE_CASE__   : int	):
       '''simple docstring'''





       _lowerCamelCase			:						int            =int(number**0.5	)
       return number == sq * sq




def       a_ (       SCREAMING_SNAKE_CASE__   : int						,     SCREAMING_SNAKE_CASE__   : int						,     SCREAMING_SNAKE_CASE__   : int						,     SCREAMING_SNAKE_CASE__   : int						,     SCREAMING_SNAKE_CASE__   : int						,     SCREAMING_SNAKE_CASE__   : int	):
       '''simple docstring'''





       _lowerCamelCase			:						int            =x_num * y_den * z_den + y_num * x_den * z_den + z_num * x_den * y_den
       _lowerCamelCase			:						int            =x_den * y_den * z_den
       _lowerCamelCase			:						int            =gcd(SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__	)
       top //= hcf
       bottom //= hcf
       return top, bottom




def       a_ (       SCREAMING_SNAKE_CASE__   : int = 35	):
       '''simple docstring'''





       _lowerCamelCase			:						set            =set()
       _lowerCamelCase			:						int
       _lowerCamelCase			:						Fraction            =Fraction(0	)
       _lowerCamelCase			:						tuple[int, int]

       for x_num in range(1						,     order + 1	):
              for x_den in range(x_num + 1						,     order + 1	):
                     for y_num in range(1						,     order + 1	):
                            for y_den in range(y_num + 1						,     order + 1	):
                                   # n=1
                                   _lowerCamelCase			:						List[Any]            =x_num * y_den + x_den * y_num
                                   _lowerCamelCase			:						Optional[int]            =x_den * y_den
                                   _lowerCamelCase			:						Tuple            =gcd(SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__	)
                                   z_num //= hcf
                                   z_den //= hcf
                                   if 0 < z_num < z_den <= order:
                                          _lowerCamelCase			:						Dict            =add_three(
                                              SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__	)
                                          unique_s.add(SCREAMING_SNAKE_CASE__	)

                                   # n=2
                                   _lowerCamelCase			:						Tuple            =(
                                       x_num * x_num * y_den * y_den + x_den * x_den * y_num * y_num
                                   )
                                   _lowerCamelCase			:						Optional[Any]            =x_den * x_den * y_den * y_den
                                   if is_sq(SCREAMING_SNAKE_CASE__	) and is_sq(SCREAMING_SNAKE_CASE__	):
                                          _lowerCamelCase			:						List[Any]            =int(sqrt(SCREAMING_SNAKE_CASE__	)	)
                                          _lowerCamelCase			:						Optional[int]            =int(sqrt(SCREAMING_SNAKE_CASE__	)	)
                                          _lowerCamelCase			:						Optional[Any]            =gcd(SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__	)
                                          z_num //= hcf
                                          z_den //= hcf
                                          if 0 < z_num < z_den <= order:
                                                 _lowerCamelCase			:						List[Any]            =add_three(
                                                     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__	)
                                                 unique_s.add(SCREAMING_SNAKE_CASE__	)

                    # n=-1
                                   _lowerCamelCase			:						Optional[Any]            =x_num * y_num
                                   _lowerCamelCase			:						Dict            =x_den * y_num + x_num * y_den
                                   _lowerCamelCase			:						List[str]            =gcd(SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__	)
                                   z_num //= hcf
                                   z_den //= hcf
                                   if 0 < z_num < z_den <= order:
                                          _lowerCamelCase			:						List[Any]            =add_three(
                                              SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__	)
                                          unique_s.add(SCREAMING_SNAKE_CASE__	)

                                   # n=2
                                   _lowerCamelCase			:						str            =x_num * x_num * y_num * y_num
                                   _lowerCamelCase			:						Tuple            =(
                                       x_den * x_den * y_num * y_num + x_num * x_num * y_den * y_den
                                   )
                                   if is_sq(SCREAMING_SNAKE_CASE__	) and is_sq(SCREAMING_SNAKE_CASE__	):
                                          _lowerCamelCase			:						List[Any]            =int(sqrt(SCREAMING_SNAKE_CASE__	)	)
                                          _lowerCamelCase			:						int            =int(sqrt(SCREAMING_SNAKE_CASE__	)	)
                                          _lowerCamelCase			:						str            =gcd(SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__	)
                                          z_num //= hcf
                                          z_den //= hcf
                                          if 0 < z_num < z_den <= order:
                                                 _lowerCamelCase			:						List[str]            =add_three(
                                                     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__	)
                                                 unique_s.add(SCREAMING_SNAKE_CASE__	)

       for num, den in unique_s:
              total += Fraction(SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__	)

       return total.denominator + total.numerator


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






from math import isqrt




def       a_ (       SCREAMING_SNAKE_CASE__   : int	):
       '''simple docstring'''





       _lowerCamelCase			:						Optional[int]            =[True] * max_number
       for i in range(2						,     isqrt(max_number - 1	) + 1	):
              if is_prime[i]:
                     for j in range(i**2						,     SCREAMING_SNAKE_CASE__						,     SCREAMING_SNAKE_CASE__	):
                            _lowerCamelCase			:						str            =False

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




def       a_ (       SCREAMING_SNAKE_CASE__   : int = 10**8	):
       '''simple docstring'''





       _lowerCamelCase			:						Union[str, Any]            =calculate_prime_numbers(max_number // 2	)

       _lowerCamelCase			:						Dict            =0
       _lowerCamelCase			:						int            =0
       _lowerCamelCase			:						Optional[Any]            =len(SCREAMING_SNAKE_CASE__	) - 1
       while left <= right:
              while prime_numbers[left] * prime_numbers[right] >= max_number:
                     right -= 1
              semiprimes_count += right - left + 1
              left += 1

       return semiprimes_count


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


