

_a	 =     float('''inf''')






class 							A_				:


     def __init__(							self    :	Optional[int]    ,						UpperCAmelCase    :	Tuple      )							->			Union[str, Any]:
      __lowerCAmelCase:     List[Any]     			=   [0] * n
      __lowerCAmelCase:     int     			=   [0] * n
      __lowerCAmelCase:     List[str]     			=   [0] * n
      __lowerCAmelCase:     Tuple     			=   [[] for _ in range(UpperCAmelCase      )]


     def 						UpperCAmelCase						(							self    :	Union[str, Any]    ,						UpperCAmelCase    :	Tuple    ,						UpperCAmelCase    :	str    ,						UpperCAmelCase    :	str    ,						UpperCAmelCase    :	Any=0      )							->			Union[str, Any]:
      self.adj[a].append([b, len(self.adj[b]      ), c, 0]      )
      self.adj[b].append([a, len(self.adj[a]      ) - 1, rcap, 0]      )


     def 						UpperCAmelCase						(							self    :	Optional[Any]    ,						UpperCAmelCase    :	Optional[Any]    ,						UpperCAmelCase    :	List[str]    ,						UpperCAmelCase    :	List[str]      )							->			Union[str, Any]:
      if vertex == sink or not flow:
       return flow

      for i in range(self.ptr[vertex]    ,						len(self.adj[vertex]      )      ):
       __lowerCAmelCase:     Dict     			=   self.adj[vertex][i]
       if self.lvl[e[0]] == self.lvl[vertex] + 1:
        __lowerCAmelCase:     str     			=   self.depth_first_search(e[0]    ,						UpperCAmelCase    ,						min(UpperCAmelCase    ,						e[2] - e[3]      )      )
        if p:
         self.adj[vertex][i][3] += p
         self.adj[e[0]][e[1]][3] -= p
         return p
       __lowerCAmelCase:     List[str]     			=   self.ptr[vertex] + 1
      return 0


     def 						UpperCAmelCase						(							self    :	List[str]    ,						UpperCAmelCase    :	int    ,						UpperCAmelCase    :	List[str]      )							->			Tuple:
      __lowerCAmelCase			,							__lowerCAmelCase:     str     			=   0, source
      for l in range(3_1      ):  # noqa: E741  l = 30 maybe faster for random data
       while True:
        __lowerCAmelCase			,							__lowerCAmelCase:     str     			=   [0] * len(self.q      ), [0] * len(self.q      )
        __lowerCAmelCase			,							__lowerCAmelCase			,							__lowerCAmelCase:     int     			=   0, 1, 1
        while qi < qe and not self.lvl[sink]:
         __lowerCAmelCase:     List[Any]     			=   self.q[qi]
         qi += 1
         for e in self.adj[v]:
          if not self.lvl[e[0]] and (e[2] - e[3]) >> (3_0 - l):
           __lowerCAmelCase:     List[str]     			=   e[0]
           qe += 1
           __lowerCAmelCase:     Any     			=   self.lvl[v] + 1

        __lowerCAmelCase:     List[str]     			=   self.depth_first_search(UpperCAmelCase    ,						UpperCAmelCase    ,						UpperCAmelCase      )
        while p:
         flow += p
         __lowerCAmelCase:     Any     			=   self.depth_first_search(UpperCAmelCase    ,						UpperCAmelCase    ,						UpperCAmelCase      )

        if not self.lvl[sink]:
         break

      return flow
_a	 =     Dinic(1_0)
_a	 =     0
_a	 =     9
for vertex in range(1, 5):
  graph.add_edge(source, vertex, 1)
for vertex in range(5, 9):
  graph.add_edge(vertex, sink, 1)
for vertex in range(1, 5):
  graph.add_edge(vertex, vertex + 4, 1)

# Now we can know that is the maximum flow(source -> sink)
print(graph.max_flow(source, sink))








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()))}")





