





import random
import sys

from . import cryptomath_module as cryptomath

_SCREAMING_SNAKE_CASE   						=		(
    R""" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`"""
    R"""abcdefghijklmnopqrstuvwxyz{|}~"""
)


def 				SCREAMING_SNAKE_CASE__    (     __a ,			__a ,			__a ):
	if mode == "encrypt":
		if key_a == 1:
			sys.exit(
			    'The affine cipher becomes weak when key '
			    'A is set to 1. Choose different key' )
		if key_b == 0:
			sys.exit(
			    'The affine cipher becomes weak when key '
			    'B is set to 0. Choose different key' )
	if key_a < 0 or key_b < 0 or key_b > len(__a ) - 1:
		sys.exit(
		    'Key A must be greater than 0 and key B must '
		    f"""be between 0 and {len(__a ) - 1}.""" )
	if cryptomath.gcd(__a ,			len(__a ) ) != 1:
		sys.exit(
		    f"""Key A {key_a} and the symbol set size {len(__a )} """
		    'are not relatively prime. Choose a different key.' )


def 				SCREAMING_SNAKE_CASE__    (     __a ,			__a ):
	snake_case_    ,snake_case_		:      Dict           =						divmod(__a ,			len(__a ) )
	check_keys(__a ,			__a ,			'encrypt' )
	snake_case_		:      Any           =						''
	for symbol in message:
		if symbol in SYMBOLS:
			snake_case_		:      Optional[Any]           =						SYMBOLS.find(__a )
			cipher_text += SYMBOLS[(sym_index * key_a + key_b) % len(__a )]
		else:
			cipher_text += symbol
	return cipher_text


def 				SCREAMING_SNAKE_CASE__    (     __a ,			__a ):
	snake_case_    ,snake_case_		:      Any           =						divmod(__a ,			len(__a ) )
	check_keys(__a ,			__a ,			'decrypt' )
	snake_case_		:      List[Any]           =						''
	snake_case_		:      Optional[int]           =						cryptomath.find_mod_inverse(__a ,			len(__a ) )
	for symbol in message:
		if symbol in SYMBOLS:
			snake_case_		:      List[str]           =						SYMBOLS.find(__a )
			plain_text += SYMBOLS[
			    (sym_index - key_b) * mod_inverse_of_key_a % len(__a )
			]
		else:
			plain_text += symbol
	return plain_text


def 				SCREAMING_SNAKE_CASE__    (     ):
	while True:
		snake_case_		:      str           =						random.randint(2 ,			len(__a ) )
		snake_case_		:      int           =						random.randint(2 ,			len(__a ) )
		if cryptomath.gcd(__a ,			len(__a ) ) == 1 and key_b % len(__a ) != 0:
			return key_b * len(__a ) + key_b


def 				SCREAMING_SNAKE_CASE__    (     ):
	snake_case_		:      Tuple           =						input('Enter message: ' ).strip()
	snake_case_		:      Optional[Any]           =						int(input('Enter key [2000 - 9000]: ' ).strip() )
	snake_case_		:      int           =						input('Encrypt/Decrypt [E/D]: ' ).strip().lower()

	if mode.startswith('e' ):
		snake_case_		:      Any           =						'encrypt'
		snake_case_		:      Union[str, Any]           =						encrypt_message(__a ,			__a )
	elif mode.startswith('d' ):
		snake_case_		:      Optional[int]           =						'decrypt'
		snake_case_		:      List[Any]           =						decrypt_message(__a ,			__a )
	print(f"""\n{mode.title()}ed text: \n{translated}""" )


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						# 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()))}')





