





'''simple docstring'''

from __future__ import annotations

from sys import maxsize
from typing import Generic, TypeVar

UpperCAmelCase					:		Optional[Any]		=							TypeVar('T')




def    _a    (							lowerCAmelCase_	):





      """simple docstring"""



      return (position - 1) // 2




def    _a    (							lowerCAmelCase_	):





      """simple docstring"""



      return (2 * position) + 1




def    _a    (							lowerCAmelCase_	):





      """simple docstring"""



      return (2 * position) + 2





class lowerCamelCase						(Generic[T]					):







  def __init__(		self		)		->						None:






        """simple docstring"""





        _snake_case		:	list[tuple[T, int]]					     =     []
        _snake_case		:	dict[T, int]					     =     {}
        _snake_case		:	int					     =     0







  def __len__(		self		)		->						int:






        """simple docstring"""





        return self.elements







  def __repr__(		self		)		->						str:






        """simple docstring"""





        return str(self.heap		)







  def 				UpperCAmelCase_				(		self		)		->						bool:






        """simple docstring"""





        return self.elements == 0







  def 				UpperCAmelCase_				(		self     ,     lowercase__     ,     lowercase__		)		->						None:






        """simple docstring"""





        self.heap.append((elem, weight)		)
        _snake_case		:	Optional[Any]					     =     self.elements
        self.elements += 1
        self._bubble_up(lowercase__		)







  def 				UpperCAmelCase_				(		self		)		->						T:






        """simple docstring"""





        if self.elements > 1:
              self._swap_nodes(0     ,     self.elements - 1		)
        _snake_case     ,							_snake_case		:	List[str]					     =     self.heap.pop()
        del self.position_map[elem]
        self.elements -= 1
        if self.elements > 0:
              _snake_case     ,							_snake_case		:	Tuple					     =     self.heap[0]
              self._bubble_down(lowercase__		)
        return elem







  def 				UpperCAmelCase_				(		self     ,     lowercase__     ,     lowercase__		)		->						None:






        """simple docstring"""





        _snake_case		:	List[str]					     =     self.position_map[elem]
        _snake_case		:	Any					     =     (elem, weight)
        if position > 0:
              _snake_case		:	Optional[int]					     =     get_parent_position(lowercase__		)
              _snake_case     ,							_snake_case		:	Tuple					     =     self.heap[parent_position]
              if parent_weight > weight:
                    self._bubble_up(lowercase__		)
              else:
                    self._bubble_down(lowercase__		)
        else:
              self._bubble_down(lowercase__		)







  def 				UpperCAmelCase_				(		self     ,     lowercase__		)		->						None:






        """simple docstring"""





        _snake_case		:	Tuple					     =     self.position_map[elem]
        if curr_pos == 0:
              return None
        _snake_case		:	Optional[int]					     =     get_parent_position(lowercase__		)
        _snake_case     ,							_snake_case		:	Optional[Any]					     =     self.heap[curr_pos]
        _snake_case     ,							_snake_case		:	int					     =     self.heap[parent_position]
        if parent_weight > weight:
              self._swap_nodes(lowercase__     ,     lowercase__		)
              return self._bubble_up(lowercase__		)
        return None







  def 				UpperCAmelCase_				(		self     ,     lowercase__		)		->						None:






        """simple docstring"""





        _snake_case		:	Any					     =     self.position_map[elem]
        _snake_case     ,							_snake_case		:	List[Any]					     =     self.heap[curr_pos]
        _snake_case		:	Dict					     =     get_child_left_position(lowercase__		)
        _snake_case		:	Optional[int]					     =     get_child_right_position(lowercase__		)
        if child_left_position < self.elements and child_right_position < self.elements:
              _snake_case     ,							_snake_case		:	Any					     =     self.heap[child_left_position]
              _snake_case     ,							_snake_case		:	str					     =     self.heap[child_right_position]
              if child_right_weight < child_left_weight and child_right_weight < weight:
                    self._swap_nodes(lowercase__     ,     lowercase__		)
                    return self._bubble_down(lowercase__		)
        if child_left_position < self.elements:
              _snake_case     ,							_snake_case		:	List[str]					     =     self.heap[child_left_position]
              if child_left_weight < weight:
                    self._swap_nodes(lowercase__     ,     lowercase__		)
                    return self._bubble_down(lowercase__		)
        else:
              return None
        if child_right_position < self.elements:
              _snake_case     ,							_snake_case		:	Optional[int]					     =     self.heap[child_right_position]
              if child_right_weight < weight:
                    self._swap_nodes(lowercase__     ,     lowercase__		)
                    return self._bubble_down(lowercase__		)
        return None







  def 				UpperCAmelCase_				(		self     ,     lowercase__     ,     lowercase__		)		->						None:






        """simple docstring"""





        _snake_case		:	List[Any]					     =     self.heap[nodea_pos][0]
        _snake_case		:	str					     =     self.heap[nodea_pos][0]
        _snake_case     ,							_snake_case		:	Union[str, Any]					     =     (
            self.heap[nodea_pos],
            self.heap[nodea_pos],
        )
        _snake_case		:	Dict					     =     nodea_pos
        _snake_case		:	Any					     =     nodea_pos





class lowerCamelCase						(Generic[T]					):







  def __init__(		self		)		->						None:






        """simple docstring"""





        _snake_case		:	dict[T, dict[T, int]]					     =     {}
        _snake_case		:	int					     =     0







  def __repr__(		self		)		->						str:






        """simple docstring"""





        return str(self.connections		)







  def __len__(		self		)		->						int:






        """simple docstring"""





        return self.nodes







  def 				UpperCAmelCase_				(		self     ,     lowercase__		)		->						None:






        """simple docstring"""





        if node not in self.connections:
              _snake_case		:	Optional[int]					     =     {}
              self.nodes += 1







  def 				UpperCAmelCase_				(		self     ,     lowercase__     ,     lowercase__     ,     lowercase__		)		->						None:






        """simple docstring"""





        self.add_node(lowercase__		)
        self.add_node(lowercase__		)
        _snake_case		:	Union[str, Any]					     =     weight
        _snake_case		:	Any					     =     weight




def    _a    (							lowerCAmelCase_			,      ):





      """simple docstring"""



      _snake_case		:	dict[T, int]					     =     {node: maxsize for node in graph.connections}
      _snake_case		:	dict[T, T | None]					     =     {node: None for node in graph.connections}

      _snake_case		:	MinPriorityQueue[T]					     =     MinPriorityQueue()
      for node, weight in dist.items():
            priority_queue.push(lowerCAmelCase_			,      lowerCAmelCase_	)

      if priority_queue.is_empty():
            return dist, parent

      # initialization
      _snake_case		:	str					     =     priority_queue.extract_min()
      _snake_case		:	Optional[int]					     =     0
      for neighbour in graph.connections[node]:
            if dist[neighbour] > dist[node] + graph.connections[node][neighbour]:
                  _snake_case		:	Dict					     =     dist[node] + graph.connections[node][neighbour]
                  priority_queue.update_key(lowerCAmelCase_			,      dist[neighbour]	)
                  _snake_case		:	int					     =     node

    # running prim's algorithm
      while not priority_queue.is_empty():
            _snake_case		:	Any					     =     priority_queue.extract_min()
            for neighbour in graph.connections[node]:
                  if dist[neighbour] > dist[node] + graph.connections[node][neighbour]:
                        _snake_case		:	int					     =     dist[node] + graph.connections[node][neighbour]
                        priority_queue.update_key(lowerCAmelCase_			,      dist[neighbour]	)
                        _snake_case		:	List[str]					     =     node
      return dist, parent









'''simple docstring'''

from collections.abc import Generator




def    _a    (							):





      """simple docstring"""



      _snake_case     ,							_snake_case		:	Union[str, Any]					     =     0, 1
      while True:
            _snake_case     ,							_snake_case		:	List[str]					     =     b, a + b
            yield b




def    _a    (							lowerCAmelCase_ = 1_000	):





      """simple docstring"""



      _snake_case		:	List[str]					     =     1
      _snake_case		:	Dict					     =     fibonacci_generator()
      while len(str(next(lowerCAmelCase_	)	)	) < n:
            answer += 1
      return answer + 1


if __name__ == "__main__":
   print(solution(int(str(input()).strip())))


