




'''simple docstring'''





from math import floor, sqrt




def       SCREAMING_SNAKE_CASE			( __UpperCamelCase    :		int   )						->							int:
    UpperCAmelCase_											=  0.0
    UpperCAmelCase_											=  1.0
    UpperCAmelCase_											=  int(sqrt(__UpperCamelCase   )   )
    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       SCREAMING_SNAKE_CASE			( __UpperCamelCase    :		int = 1_0000   )						->							int:
    UpperCAmelCase_											=  0
    for i in range(2 ,  n + 1   ):
        UpperCAmelCase_											=  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()))}")











def       SCREAMING_SNAKE_CASE			( )						->							List[Any]:
    UpperCAmelCase_											=  1

    while True:
        if (
            sorted(str(__UpperCamelCase   )   )
            == sorted(str(2 * i   )   )
            == sorted(str(3 * i   )   )
            == sorted(str(4 * i   )   )
            == sorted(str(5 * i   )   )
            == sorted(str(6 * i   )   )
        ):
            return i

        i += 1


if __name__ == "__main__":
 print(solution())





