



"""simple docstring"""
import random
import unittest

import torch

from diffusers import IFSuperResolutionPipeline
from diffusers.utils import floats_tensor
from diffusers.utils.import_utils import is_xformers_available
from diffusers.utils.testing_utils import skip_mps, torch_device

from ..pipeline_params import TEXT_GUIDED_IMAGE_VARIATION_BATCH_PARAMS, TEXT_GUIDED_IMAGE_VARIATION_PARAMS
from ..test_pipelines_common import PipelineTesterMixin
from . import IFPipelineTesterMixin
@skip_mps
class 							lowerCamelCase    (     _lowerCAmelCase       ,		_lowerCAmelCase       ,		unittest.TestCase							):






					'''simple docstring'''





					_A						:     Dict		=	IFSuperResolutionPipeline
					_A						:     Optional[Any]		=	TEXT_GUIDED_IMAGE_VARIATION_PARAMS - {"""width""", """height"""}
					_A						:     str		=	TEXT_GUIDED_IMAGE_VARIATION_BATCH_PARAMS
					_A						:     Tuple		=	PipelineTesterMixin.required_optional_params - {"""latents"""}






					def   lowerCAmelCase_							(			self:				Tuple		)  ->      Any:
											return self._get_superresolution_dummy_components()






					def   lowerCAmelCase_							(			self:				Dict		,	snake_case:				Tuple		,	snake_case:				str=0		)  ->      Any:
											if str(snake_case		).startswith("""mps"""		):
																	snake_case_					:int		=     torch.manual_seed(snake_case		)
											else:
																	snake_case_					:str		=     torch.Generator(device=snake_case		).manual_seed(snake_case		)

											snake_case_					:List[Any]		=     floats_tensor((1, 3, 32, 32)		,	rng=random.Random(snake_case		)		).to(snake_case		)

											snake_case_					:Optional[int]		=     {
											    """prompt""": """A painting of a squirrel eating a burger""",
											    """image""": image,
											    """generator""": generator,
											    """num_inference_steps""": 2,
											    """output_type""": """numpy""",
											}

											return inputs






					@unittest.skipIf(
					    torch_device != """cuda""" or not is_xformers_available()		,	reason="""XFormers attention is only available with CUDA and `xformers` installed"""		,	)
					def   lowerCAmelCase_							(			self:				Optional[Any]		)  ->      int:
											self._test_xformers_attention_forwardGenerator_pass(expected_max_diff=1E-3		)






					def   lowerCAmelCase_							(			self:				Union[str, Any]		)  ->      Optional[Any]:
											self._test_save_load_optional_components()






					@unittest.skipIf(torch_device != """cuda"""		,	reason="""float16 requires CUDA"""		)
					def   lowerCAmelCase_							(			self:				List[str]		)  ->      str:
											# Due to non-determinism in save load of the hf-internal-testing/tiny-random-t5 text encoder
											super().test_save_load_floataa(expected_max_diff=1E-1		)






					def   lowerCAmelCase_							(			self:				Any		)  ->      Optional[int]:
											self._test_attention_slicing_forward_pass(expected_max_diff=1E-2		)






					def   lowerCAmelCase_							(			self:				Union[str, Any]		)  ->      List[str]:
											self._test_save_load_local()






					def   lowerCAmelCase_							(			self:				Union[str, Any]		)  ->      List[Any]:
											self._test_inference_batch_single_identical(
											    expected_max_diff=1E-2		,	)





"""simple docstring"""







from math import floor, sqrt


def  __SCREAMING_SNAKE_CASE (  __UpperCAmelCase      ):
		_lowercase				: Optional[int]     =   0.0
		_lowercase				: Dict     =   1.0
		_lowercase				: Optional[int]     =   int(sqrt(__UpperCAmelCase      )      )
		_lowercase				: Optional[Any]     =   root
		_lowercase				: Dict     =   0
		while integer_part != 2 * root:
				_lowercase				: str     =   denominator * integer_part - numerator
				_lowercase				: Optional[int]     =   (n - numerator**2) / denominator
				_lowercase				: List[str]     =   int((root + numerator) / denominator      )
				period += 1
		return period


def  __SCREAMING_SNAKE_CASE (  __UpperCAmelCase = 10000      ):
		_lowercase				: List[str]     =   0
		for i in range(2   ,				n + 1      ):
				_lowercase				: Dict     =   sqrt(__UpperCAmelCase      )
				if sr - floor(__UpperCAmelCase      ) != 0 and continuous_fraction_period(__UpperCAmelCase      ) % 2 == 1:
						count_odd_periods += 1
		return count_odd_periods


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



