
from math import floor, sqrt




def 		lowerCAmelCase_     (     _SCREAMING_SNAKE_CASE  )   ->      int:

							"""simple docstring"""






							_UpperCAmelCase  :			Tuple	       =		0.0
							_UpperCAmelCase  :			str	       =		1.0
							_UpperCAmelCase  :			Optional[int]	       =		int(sqrt(_SCREAMING_SNAKE_CASE  )  )
							_UpperCAmelCase  :			Optional[Any]	       =		root
							_UpperCAmelCase  :			Dict	       =		0
							while integer_part != 2 * root:
														_UpperCAmelCase  :			Optional[Any]	       =		denominator * integer_part - numerator
														_UpperCAmelCase  :			Tuple	       =		(n - numerator**2) / denominator
														_UpperCAmelCase  :			str	       =		int((root + numerator) / denominator  )
														period += 1
							return period




def 		lowerCAmelCase_     (     _SCREAMING_SNAKE_CASE = 1_0_0_0_0  )   ->      int:

							"""simple docstring"""






							_UpperCAmelCase  :			Optional[Any]	       =		0
							for i in range(2      ,	n + 1  ):
														_UpperCAmelCase  :			Optional[Any]	       =		sqrt(_SCREAMING_SNAKE_CASE  )
														if sr - floor(_SCREAMING_SNAKE_CASE  ) != 0 and continuous_fraction_period(_SCREAMING_SNAKE_CASE  ) % 2 == 1:
																					count_odd_periods += 1
							return count_odd_periods


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






import torch

from accelerate import Accelerator, DistributedType
class    _UpperCamelCase:

						def __enter__(					self		:			str			):
													if self.enabled:
																				_UpperCAmelCase  :			int	       =		self.model.no_sync()
																				self.model_sync_obj.__enter__()

													return self

						def __exit__(					self		:			str	,						_lowerCamelCase		:			Union[str, Any]	,						_lowerCamelCase		:			Tuple	,						_lowerCamelCase		:			Optional[Any]			):
													if self.enabled:
																				# Average all models on exit
																				self._sync_and_avg_model_params()
																				self.model_sync_obj.__exit__(_lowerCamelCase	,						_lowerCamelCase	,						_lowerCamelCase			)

						def __init__(					self		:			str	,						_lowerCamelCase		:			Accelerator	,						_lowerCamelCase		:			torch.nn.Module	,						_lowerCamelCase		:			int	,						_lowerCamelCase		:			bool = True			):
													if accelerator.distributed_type not in [
													    DistributedType.NO,
													    DistributedType.MULTI_CPU,
													    DistributedType.MULTI_GPU,
													]:
																				raise NotImplementedError("LocalSGD is supported only for CPUs and GPUs (no DeepSpeed or MegatronLM)"			)
													_UpperCAmelCase  :			Any	       =		enabled and accelerator.distributed_type != DistributedType.NO
													_UpperCAmelCase  :			str	       =		0
													if self.enabled:
																				_UpperCAmelCase  :			Tuple	       =		accelerator
																				_UpperCAmelCase  :			List[str]	       =		model
																				_UpperCAmelCase  :			Dict	       =		local_sgd_steps

						def 						a__ (					self		:			Optional[int]			):
													self.num_steps += 1
													if not self.enabled:
																				return

													if self.num_steps % self.local_sgd_steps == 0:
																				self._sync_and_avg_model_params()






						def 						a__ (					self		:			Tuple			):
													self.accelerator.wait_for_everyone()
													with self.accelerator.autocast():
																				for param in self.model.parameters():
																											_UpperCAmelCase  :			Optional[Any]	       =		self.accelerator.reduce(param.data	,						reduction="mean"			)




