
"""simple docstring"""







import inspect
import os
import unittest

import torch

import accelerate
from accelerate import debug_launcher
from accelerate.test_utils import (
    execute_subprocess_async,
    require_cpu,
    require_multi_gpu,
    require_single_gpu,
    test_sync,
)
from accelerate.utils import patch_environment






class     __a			(					unittest.TestCase			):







       def    _snake_case			(					self		):



          '''simple docstring'''

          _UpperCAmelCase   	=					inspect.getfile(accelerate.test_utils		)
          _UpperCAmelCase   	=					os.path.sep.join(mod_file.split(os.path.sep		)[:-1] + ["scripts", "test_sync.py"]		)







       @require_cpu
       def    _snake_case			(					self		):



          '''simple docstring'''

          debug_launcher(test_sync.main							,num_processes=1		)







       @require_cpu
       def    _snake_case			(					self		):



          '''simple docstring'''

          debug_launcher(test_sync.main		)







       @require_single_gpu
       def    _snake_case			(					self		):



          '''simple docstring'''

          test_sync.main()







       @require_multi_gpu
       def    _snake_case			(					self		):



          '''simple docstring'''

          print(f'''Found {torch.cuda.device_count()} devices.'''		)
          _UpperCAmelCase   	=					["torchrun", f'''--nproc_per_node={torch.cuda.device_count()}''', self.test_file_path]
          with patch_environment(omp_num_threads=1		):
             execute_subprocess_async(lowerCamelCase_							,env=os.environ.copy()		)



"""simple docstring"""







from math import floor, sqrt
def 			__UpperCAmelCase		(		a_			:		int				)     ->       int:
   _UpperCAmelCase   	=					0.0
   _UpperCAmelCase   	=					1.0
   _UpperCAmelCase   	=					int(sqrt(a_				)				)
   _UpperCAmelCase   	=					root
   _UpperCAmelCase   	=					0
   while integer_part != 2 * root:
      _UpperCAmelCase   	=					denominator * integer_part - numerator
      _UpperCAmelCase   	=					(n - numerator**2) / denominator
      _UpperCAmelCase   	=					int((root + numerator) / denominator				)
      period += 1
   return period
def 			__UpperCAmelCase		(		a_			:		int = 1_00_00				)     ->       int:
   _UpperCAmelCase   	=					0
   for i in range(2    ,  n + 1				):
      _UpperCAmelCase   	=					sqrt(a_				)
      if sr - floor(a_				) != 0 and continuous_fraction_period(a_				) % 2 == 1:
         count_odd_periods += 1
   return count_odd_periods


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

