

from __future__ import annotations

from typing import Generic, TypeVar

_a	 =     TypeVar('''T''')






class 							A_				(	Generic[T]      ):


     def __init__(							self    :	Optional[int]    ,						UpperCAmelCase    :	T      )							->			Tuple:
      __lowerCAmelCase:     List[str]     			=   data  # Assign data
      __lowerCAmelCase:     Node[T] | None     			=   None  # Initialize next as null
      __lowerCAmelCase:     Node[T] | None     			=   None  # Initialize prev as null







class 							A_				(	Generic[T]      ):


     def __init__(							self    :	int      )							->			None:
      __lowerCAmelCase:     Node[T] | None     			=   None


     def 						UpperCAmelCase						(							self    :	List[Any]    ,						UpperCAmelCase    :	T      )							->			None:
      if self.head is None:
       __lowerCAmelCase:     Optional[Any]     			=   Node(UpperCAmelCase      )
      else:
       __lowerCAmelCase:     str     			=   Node(UpperCAmelCase      )
       __lowerCAmelCase:     Optional[int]     			=   new_node
       __lowerCAmelCase:     Optional[int]     			=   self.head
       __lowerCAmelCase:     Tuple     			=   None
       __lowerCAmelCase:     Any     			=   new_node


     def 						UpperCAmelCase						(							self    :	Union[str, Any]      )							->			T | None:
      if self.head is None:
       return None
      else:
       assert self.head is not None
       __lowerCAmelCase:     List[str]     			=   self.head.data
       __lowerCAmelCase:     int     			=   self.head.next
       if self.head is not None:
        __lowerCAmelCase:     List[str]     			=   None
       return temp


     def 						UpperCAmelCase						(							self    :	Optional[int]      )							->			T | None:
      return self.head.data if self.head is not None else None


     def __len__(							self    :	int      )							->			int:
      __lowerCAmelCase:     str     			=   self.head
      __lowerCAmelCase:     int     			=   0
      while temp is not None:
       count += 1
       __lowerCAmelCase:     str     			=   temp.next
      return count


     def 						UpperCAmelCase						(							self    :	Optional[int]      )							->			bool:
      return self.head is None


     def 						UpperCAmelCase						(							self    :	Union[str, Any]      )							->			None:
      print('stack elements are:'      )
      __lowerCAmelCase:     Tuple     			=   self.head
      while temp is not None:
       print(temp.data    ,						end='->'      )
       __lowerCAmelCase:     Any     			=   temp.next


# Code execution starts here
if __name__ == "__main__":
  # Start with the empty stack
  _a	 =     Stack()

  # Insert 4 at the beginning. So stack becomes 4->None
  print('''Stack operations using Doubly LinkedList''')
  stack.push(4)

  # Insert 5 at the beginning. So stack becomes 4->5->None
  stack.push(5)

  # Insert 6 at the beginning. So stack becomes 4->5->6->None
  stack.push(6)

  # Insert 7 at the beginning. So stack becomes 4->5->6->7->None
  stack.push(7)

  # Print the stack
  stack.print_stack()

  # Print the top element
  print('''\nTop element is ''', stack.top())

  # Print the stack size
  print('''Size of the stack is ''', len(stack))

  # pop the top element
  stack.pop()

  # pop the top element
  stack.pop()

  # two elements have now been popped off
  stack.print_stack()

  # Print True if the stack is empty else False
  print('''\nstack is empty:''', stack.is_empty())








from math import floor, sqrt







def _a				( SCREAMING_SNAKE_CASE	:    int	)					->					int:

 """simple docstring"""






 __lowerCAmelCase:     Optional[int]     			=   0.0
 __lowerCAmelCase:     Any     			=   1.0
 __lowerCAmelCase:     List[str]     			=   int(sqrt(SCREAMING_SNAKE_CASE	)	)
 __lowerCAmelCase:     Union[str, Any]     			=   root
 __lowerCAmelCase:     List[str]     			=   0
 while integer_part != 2 * root:
  __lowerCAmelCase:     List[str]     			=   denominator * integer_part - numerator
  __lowerCAmelCase:     Optional[int]     			=   (n - numerator**2) / denominator
  __lowerCAmelCase:     Union[str, Any]     			=   int((root + numerator) / denominator	)
  period += 1
 return period







def _a				( SCREAMING_SNAKE_CASE	:    int = 1_00_00	)					->					int:

 """simple docstring"""






 __lowerCAmelCase:     Optional[int]     			=   0
 for i in range(2					,      n + 1	):
  __lowerCAmelCase:     List[str]     			=   sqrt(SCREAMING_SNAKE_CASE	)
  if sr - floor(SCREAMING_SNAKE_CASE	) != 0 and continuous_fraction_period(SCREAMING_SNAKE_CASE	) % 2 == 1:
   count_odd_periods += 1
 return count_odd_periods


if __name__ == "__main__":
  print(f"{solution(int(input().strip()))}")





