


'''simple docstring'''



from math import floor, sqrt



def       UpperCAmelCase__ (     UpperCAmelCase_   :    int							)					->		int:
     __lowerCamelCase       :     List[str]        =		0.0
     __lowerCamelCase       :     int        =		1.0
     __lowerCamelCase       :     Dict        =		int(sqrt(UpperCAmelCase_							)							)
     __lowerCamelCase       :     Optional[Any]        =		root
     __lowerCamelCase       :     Optional[Any]        =		0
     while integer_part != 2 * root:
          __lowerCamelCase       :     Optional[Any]        =		denominator * integer_part - numerator
          __lowerCamelCase       :     int        =		(n - numerator**2) / denominator
          __lowerCamelCase       :     int        =		int((root + numerator) / denominator							)
          period += 1
     return period



def       UpperCAmelCase__ (     UpperCAmelCase_   :    int = 1_00_00							)					->		int:
     __lowerCamelCase       :     int        =		0
     for i in range(2				,   n + 1							):
          __lowerCamelCase       :     List[Any]        =		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()))}''')










'''simple docstring'''



def       UpperCAmelCase__ (     UpperCAmelCase_   :    int = 4_00_00_00							)					->		int:
     __lowerCamelCase       :     int        =		1
     __lowerCamelCase       :     Union[str, Any]        =		2
     __lowerCamelCase       :     Optional[int]        =		0
     while j <= n:
          if j % 2 == 0:
               total += j
          __lowerCamelCase    ,	__lowerCamelCase       :     List[Any]        =		j, i + j

     return total


if __name__ == "__main__":
      print(f'''{solution() = }''')






