"""simple docstring"""



from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt







def 						__lowerCAmelCase		(		lowercase						:						int				)			->		bool:


    """simple docstring"""





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







def 						__lowerCAmelCase		(		lowercase						:						int		,							lowercase						:						int		,							lowercase						:						int		,							lowercase						:						int		,							lowercase						:						int		,							lowercase						:						int				)			->		tuple[int, int]:


    """simple docstring"""





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







def 						__lowerCAmelCase		(		lowercase						:						int = 35				)			->		int:


    """simple docstring"""





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

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

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

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

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

    return total.denominator + total.numerator


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









"""simple docstring"""



from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


__snake_case         =					{
    """configuration_distilbert""": [
        """DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """DistilBertConfig""",
        """DistilBertOnnxConfig""",
    ],
    """tokenization_distilbert""": ["""DistilBertTokenizer"""],
}

try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __snake_case         =					["""DistilBertTokenizerFast"""]

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __snake_case         =					[
      """DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """DistilBertForMaskedLM""",
      """DistilBertForMultipleChoice""",
      """DistilBertForQuestionAnswering""",
      """DistilBertForSequenceClassification""",
      """DistilBertForTokenClassification""",
      """DistilBertModel""",
      """DistilBertPreTrainedModel""",
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __snake_case         =					[
      """TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """TFDistilBertForMaskedLM""",
      """TFDistilBertForMultipleChoice""",
      """TFDistilBertForQuestionAnswering""",
      """TFDistilBertForSequenceClassification""",
      """TFDistilBertForTokenClassification""",
      """TFDistilBertMainLayer""",
      """TFDistilBertModel""",
      """TFDistilBertPreTrainedModel""",
  ]

try:
  if not is_flax_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __snake_case         =					[
      """FlaxDistilBertForMaskedLM""",
      """FlaxDistilBertForMultipleChoice""",
      """FlaxDistilBertForQuestionAnswering""",
      """FlaxDistilBertForSequenceClassification""",
      """FlaxDistilBertForTokenClassification""",
      """FlaxDistilBertModel""",
      """FlaxDistilBertPreTrainedModel""",
  ]


if TYPE_CHECKING:
  from .configuration_distilbert import (
      DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP,
      DistilBertConfig,
      DistilBertOnnxConfig,
  )
  from .tokenization_distilbert import DistilBertTokenizer

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_distilbert_fast import DistilBertTokenizerFast

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_distilbert import (
        DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
        DistilBertForMaskedLM,
        DistilBertForMultipleChoice,
        DistilBertForQuestionAnswering,
        DistilBertForSequenceClassification,
        DistilBertForTokenClassification,
        DistilBertModel,
        DistilBertPreTrainedModel,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_distilbert import (
        TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
        TFDistilBertForMaskedLM,
        TFDistilBertForMultipleChoice,
        TFDistilBertForQuestionAnswering,
        TFDistilBertForSequenceClassification,
        TFDistilBertForTokenClassification,
        TFDistilBertMainLayer,
        TFDistilBertModel,
        TFDistilBertPreTrainedModel,
    )

  try:
    if not is_flax_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_flax_distilbert import (
        FlaxDistilBertForMaskedLM,
        FlaxDistilBertForMultipleChoice,
        FlaxDistilBertForQuestionAnswering,
        FlaxDistilBertForSequenceClassification,
        FlaxDistilBertForTokenClassification,
        FlaxDistilBertModel,
        FlaxDistilBertPreTrainedModel,
    )

else:
  import sys

  __snake_case         =					_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)





