
"""simple docstring"""


from math import floor, sqrt






def        lowerCAmelCase_       (		snake_case_		:      int      )       ->int:
			lowerCamelCase__     :					Any		=0.0
			lowerCamelCase__     :					Optional[int]		=1.0
			lowerCamelCase__     :					Optional[int]		=int(sqrt(snake_case_      )      )
			lowerCamelCase__     :					List[str]		=root
			lowerCamelCase__     :					Optional[int]		=0
			while integer_part != 2 * root:
						lowerCamelCase__     :					Any		=denominator * integer_part - numerator
						lowerCamelCase__     :					Optional[Any]		=(n - numerator**2) / denominator
						lowerCamelCase__     :					int		=int((root + numerator) / denominator      )
						period += 1
			return period






def        lowerCAmelCase_       (		snake_case_		:      int = 1_0_0_0_0      )       ->int:
			lowerCamelCase__     :					List[Any]		=0
			for i in range(2							,   n + 1      ):
						lowerCamelCase__     :					List[str]		=sqrt(snake_case_      )
						if sr - floor(snake_case_      ) != 0 and continuous_fraction_period(snake_case_      ) % 2 == 1:
									count_odd_periods += 1
			return count_odd_periods


if __name__ == "__main__":
							print(f"""{solution(int(input().strip()))}""")

"""simple docstring"""


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowerCAmelCase								=						{
    """configuration_decision_transformer""": [
        """DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """DecisionTransformerConfig""",
    ],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							lowerCAmelCase								=						[
							    """DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
							    """DecisionTransformerGPT2Model""",
							    """DecisionTransformerGPT2PreTrainedModel""",
							    """DecisionTransformerModel""",
							    """DecisionTransformerPreTrainedModel""",
							]


if TYPE_CHECKING:
							from .configuration_decision_transformer import (
							    DECISION_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
							    DecisionTransformerConfig,
							)

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_decision_transformer import (
														    DECISION_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
														    DecisionTransformerGPTaModel,
														    DecisionTransformerGPTaPreTrainedModel,
														    DecisionTransformerModel,
														    DecisionTransformerPreTrainedModel,
														)


else:
							import sys

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