



#
# Sort large text files in a minimum amount of memory
#
import argparse
import os

class        _A			:
       UpperCamelCase__    :       Dict		   =		'''block_{0}.dat'''



       def __init__(						self				:	Union[str, Any]	,						__SCREAMING_SNAKE_CASE				:	Optional[int]):


           '''simple docstring'''

           __a					=							filename
           __a					=							[]



       def 						_lowerCamelCase     (						self				:	Optional[Any]	,						__SCREAMING_SNAKE_CASE				:	Any	,						__SCREAMING_SNAKE_CASE				:	Tuple):


           '''simple docstring'''

           __a					=							self.BLOCK_FILENAME_FORMAT.format(__SCREAMING_SNAKE_CASE)
           with open(__SCREAMING_SNAKE_CASE	,						'''w''') as file:
               file.write(__SCREAMING_SNAKE_CASE)
           self.block_filenames.append(__SCREAMING_SNAKE_CASE)



       def 						_lowerCamelCase     (						self				:	Optional[int]):


           '''simple docstring'''

           return self.block_filenames



       def 						_lowerCamelCase     (						self				:	Tuple	,						__SCREAMING_SNAKE_CASE				:	Optional[int]	,						__SCREAMING_SNAKE_CASE				:	Tuple=None):


           '''simple docstring'''

           __a					=							0
           with open(self.filename) as file:
               while True:
                   __a					=							file.readlines(__SCREAMING_SNAKE_CASE)

                   if lines == []:
                       break

                   if sort_key is None:
                       lines.sort()
                   else:
                       lines.sort(key=__SCREAMING_SNAKE_CASE)

                   self.write_block(''''''.join(__SCREAMING_SNAKE_CASE)	,						__SCREAMING_SNAKE_CASE)
                   i += 1





       def 						_lowerCamelCase     (						self				:	Tuple):


           '''simple docstring'''

           map(os.remove	,						self.block_filenames)


class        _A			:



       def 						_lowerCamelCase     (						self				:	str	,						__SCREAMING_SNAKE_CASE				:	List[str]):


           '''simple docstring'''

           __a					=							-1
           __a					=							None

           for i in range(len(__SCREAMING_SNAKE_CASE)):
               if min_str is None or choices[i] < min_str:
                   __a					=							i

           return min_index


class        _A			:



       def __init__(						self				:	str	,						__SCREAMING_SNAKE_CASE				:	Optional[int]):


           '''simple docstring'''

           __a					=							files
           __a					=							set()
           __a					=							len(__SCREAMING_SNAKE_CASE)
           __a					=							{i: None for i in range(self.num_buffers)}



       def 						_lowerCamelCase     (						self				:	int):


           '''simple docstring'''

           return {
               i: self.buffers[i] for i in range(self.num_buffers) if i not in self.empty
           }



       def 						_lowerCamelCase     (						self				:	Tuple):


           '''simple docstring'''

           for i in range(self.num_buffers):
               if self.buffers[i] is None and i not in self.empty:
                   __a					=							self.files[i].readline()

                   if self.buffers[i] == "":
                       self.empty.add(__SCREAMING_SNAKE_CASE)
                       self.files[i].close()

           if len(self.empty) == self.num_buffers:
               return False

           return True





       def 						_lowerCamelCase     (						self				:	Dict	,						__SCREAMING_SNAKE_CASE				:	List[str]):


           '''simple docstring'''

           __a					=							self.buffers[index]
           __a					=							None

           return value


class        _A			:



       def __init__(						self				:	Union[str, Any]	,						__SCREAMING_SNAKE_CASE				:	List[str]):


           '''simple docstring'''

           __a					=							merge_strategy



       def 						_lowerCamelCase     (						self				:	str	,						__SCREAMING_SNAKE_CASE				:	str	,						__SCREAMING_SNAKE_CASE				:	Optional[Any]	,						__SCREAMING_SNAKE_CASE				:	Union[str, Any]):


           '''simple docstring'''

           __a					=							FilesArray(self.get_file_handles(__SCREAMING_SNAKE_CASE	,						__SCREAMING_SNAKE_CASE))
           with open(__SCREAMING_SNAKE_CASE	,						'''w'''	,						__SCREAMING_SNAKE_CASE) as outfile:
               while buffers.refresh():
                   __a					=							self.merge_strategy.select(buffers.get_dict())
                   outfile.write(buffers.unshift(__SCREAMING_SNAKE_CASE))





       def 						_lowerCamelCase     (						self				:	List[str]	,						__SCREAMING_SNAKE_CASE				:	Optional[int]	,						__SCREAMING_SNAKE_CASE				:	List[str]):


           '''simple docstring'''

           __a					=							{}

           for i in range(len(__SCREAMING_SNAKE_CASE)):
               __a					=							open(filenames[i]	,						'''r'''	,						__SCREAMING_SNAKE_CASE)  # noqa: UP015

           return files


class        _A			:



       def __init__(						self				:	List[Any]	,						__SCREAMING_SNAKE_CASE				:	Optional[int]):


           '''simple docstring'''

           __a					=							block_size



       def 						_lowerCamelCase     (						self				:	List[Any]	,						__SCREAMING_SNAKE_CASE				:	str	,						__SCREAMING_SNAKE_CASE				:	Union[str, Any]=None):


           '''simple docstring'''

           __a					=							self.get_number_blocks(__SCREAMING_SNAKE_CASE	,						self.block_size)
           __a					=							FileSplitter(__SCREAMING_SNAKE_CASE)
           splitter.split(self.block_size	,						__SCREAMING_SNAKE_CASE)

           __a					=							FileMerger(NWayMerge())
           __a					=							self.block_size / (num_blocks + 1)
           merger.merge(splitter.get_block_filenames()	,						filename + '''.out'''	,						__SCREAMING_SNAKE_CASE)

           splitter.cleanup()





       def 						_lowerCamelCase     (						self				:	Any	,						__SCREAMING_SNAKE_CASE				:	Dict	,						__SCREAMING_SNAKE_CASE				:	Union[str, Any]):


           '''simple docstring'''

           return (os.stat(__SCREAMING_SNAKE_CASE).st_size / block_size) + 1





def 	__snake_case      (     _UpperCAmelCase							):
    if string[-1].lower() == "k":
        return int(string[:-1]							) * 1024
    elif string[-1].lower() == "m":
        return int(string[:-1]							) * 1024 * 1024
    elif string[-1].lower() == "g":
        return int(string[:-1]							) * 1024 * 1024 * 1024
    else:
        return int(_UpperCAmelCase							)





def 	__snake_case      (     ):
    __a					=							argparse.ArgumentParser()
    parser.add_argument(
        '''-m'''  ,					'''--mem'''  ,					help='''amount of memory to use for sorting'''  ,					default='''100M'''							)
    parser.add_argument(
        '''filename'''  ,					metavar='''<filename>'''  ,					nargs=1  ,					help='''name of file to sort'''							)
    __a					=							parser.parse_args()

    __a					=							ExternalSort(parse_memory(args.mem							)							)
    sorter.sort(args.filename[0]							)


if __name__ == "__main__":
 main()










from math import floor, sqrt





def 	__snake_case      (     _UpperCAmelCase							):
    __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 	__snake_case      (     _UpperCAmelCase = 10000							):
    __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()))}')





