

from math import floor, sqrt






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






def        __lowercase   (  _A = 10000      )  ->    int:
      SCREAMING_SNAKE_CASE			:   int	  = 0
      for i in range(2    ,     n + 1      ):
            SCREAMING_SNAKE_CASE			:   Union[str, Any]	  = 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()))}""")







import itertools






def        __lowercase   (  _A = 1000000      )  ->    int:
      SCREAMING_SNAKE_CASE			:   Tuple	  = [1]

      for i in itertools.count(len(_A      )      ):
            SCREAMING_SNAKE_CASE			:   Optional[int]	  = 0
            for j in itertools.count(1      ):
                  SCREAMING_SNAKE_CASE			:   str	  = -1 if j % 2 == 0 else +1
                  SCREAMING_SNAKE_CASE			:   Any	  = (j * j * 3 - j) // 2
                  if index > i:
                        break
                  item += partitions[i - index] * sign
                  item %= number
                  index += j
                  if index > i:
                        break
                  item += partitions[i - index] * sign
                  item %= number

            if item == 0:
                  return i
            partitions.append(_A      )

      return 0


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  print(F"""{solution() = }""")




