






from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt

def   __lowercase       (			snake_case			):







				"""simple docstring"""






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

def   __lowercase       (			snake_case,	snake_case,	snake_case,	snake_case,	snake_case,	snake_case			):







				"""simple docstring"""






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

def   __lowercase       (			snake_case = 3_5			):







				"""simple docstring"""






				__magic_name__		:set   =   set()
				__magic_name__		:int
				__magic_name__		:Fraction   =   Fraction(0			)
				__magic_name__		: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
																				__magic_name__		:Any   =   x_num * y_den + x_den * y_num
																				__magic_name__		:Dict   =   x_den * y_den
																				__magic_name__		:Any   =   gcd(snake_case,	snake_case			)
																				z_num //= hcf
																				z_den //= hcf
																				if 0 < z_num < z_den <= order:
																								__magic_name__		:List[str]   =   add_three(
																								    snake_case,	snake_case,	snake_case,	snake_case,	snake_case,	snake_case			)
																								unique_s.add(snake_case			)

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

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

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

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

				return total.denominator + total.numerator


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














from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available


SCREAMING_SNAKE_CASE__   :      Optional[int]				=		{"""tokenization_herbert""": ["""HerbertTokenizer"""]}

try:
					if not is_tokenizers_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					SCREAMING_SNAKE_CASE__   :      Optional[Any]				=		["""HerbertTokenizerFast"""]


if TYPE_CHECKING:
					from .tokenization_herbert import HerbertTokenizer

					try:
										if not is_tokenizers_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .tokenization_herbert_fast import HerbertTokenizerFast

else:
					import sys

					SCREAMING_SNAKE_CASE__   :      Union[str, Any]				=		_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)






