






'''simple docstring'''
from math import floor, sqrt

def 							a	(   _UpperCAmelCase )				->				int:






					"""simple docstring"""







					a_									=   0.0
					a_									=   1.0
					a_									=   int(sqrt(_UpperCAmelCase ) )
					a_									=   root
					a_									=   0
					while integer_part != 2 * root:
										a_									=   denominator * integer_part - numerator
										a_									=   (n - numerator**2) / denominator
										a_									=   int((root + numerator) / denominator )
										period += 1
					return period

def 							a	(   _UpperCAmelCase = 1_0_0_0_0 )				->				int:






					"""simple docstring"""







					a_									=   0
					for i in range(2					,  n + 1 ):
										a_									=   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()))}''')









'''simple docstring'''
from typing import List, Optional, Tuple, Union

import torch

from ...models import UNetaDModel
from ...schedulers import PNDMScheduler
from ...utils import randn_tensor
from ..pipeline_utils import DiffusionPipeline, ImagePipelineOutput


class    _snake_case   (				snake_case					):

					"""simple docstring"""





					_UpperCamelCase		 =      42
					_UpperCamelCase		 =      42




					def __init__(     self   , UpperCAmelCase__   , UpperCAmelCase__     )      ->	int:
										super().__init__()

										a_									=   PNDMScheduler.from_config(scheduler.config     )

										self.register_modules(unet=UpperCAmelCase__   , scheduler=UpperCAmelCase__     )




					@torch.no_grad()
					def __call__(     self   , UpperCAmelCase__ = 1   , UpperCAmelCase__ = 50   , UpperCAmelCase__ = None   , UpperCAmelCase__ = "pil"   , UpperCAmelCase__ = True   , **UpperCAmelCase__   , )      ->	Union[ImagePipelineOutput, Tuple]:
										a_									=   randn_tensor(
										    (batch_size, self.unet.config.in_channels, self.unet.config.sample_size, self.unet.config.sample_size)   , generator=UpperCAmelCase__   , device=self.device   , )

										self.scheduler.set_timesteps(UpperCAmelCase__     )
										for t in self.progress_bar(self.scheduler.timesteps     ):
															a_									=   self.unet(UpperCAmelCase__   , UpperCAmelCase__     ).sample

															a_									=   self.scheduler.step(UpperCAmelCase__   , UpperCAmelCase__   , UpperCAmelCase__     ).prev_sample

										a_									=   (image / 2 + 0.5).clamp(0   , 1     )
										a_									=   image.cpu().permute(0   , 2   , 3   , 1     ).numpy()
										if output_type == "pil":
															a_									=   self.numpy_to_pil(UpperCAmelCase__     )

										if not return_dict:
															return (image,)

										return ImagePipelineOutput(images=UpperCAmelCase__     )

