
'''simple docstring'''






import builtins
import sys

from ...utils.imports import _is_package_available
from . import cursor, input
from .helpers import Direction, clear_line, forceWrite, linebreak, move_cursor, reset_cursor, writeColor
from .keymap import KEYMAP


UpperCAmelCase_							: Any =							False
try:
 UpperCAmelCase_							: Dict =							_is_package_available('google.colab')
except ModuleNotFoundError:
 pass

@input.register
class 			UpperCAmelCase__    :



    def __init__(						self   :							Union[str, Any],__A   :							str = None,__A   :							list = []  ):
          _lowerCamelCase					: List[Any]		    = 0
          _lowerCamelCase					: Tuple		    = choices
          _lowerCamelCase					: str		    = prompt
          if sys.platform == "win32":
                _lowerCamelCase					: List[str]		    = "*"
          else:
                _lowerCamelCase					: int		    = "➔ "



    def 	lowerCamelCase_	(						self   :							Optional[Any],__A   :							Any,__A   :							str = ""  ):
          if sys.platform != "win32":
                writeColor(self.choices[index],3_2,__A  )
          else:
                forceWrite(self.choices[index],__A  )



    def 	lowerCamelCase_	(						self   :							Union[str, Any],__A   :							int  ):
          if index == self.position:
                forceWrite(f' {self.arrow_char} '  )
                self.write_choice(__A  )
          else:
                forceWrite(f'    {self.choices[index]}'  )
          reset_cursor()



    def 	lowerCamelCase_	(						self   :							Union[str, Any],__A   :							Direction,__A   :							int = 1  ):
          _lowerCamelCase					: Any		    = self.position
          if direction == Direction.DOWN:
                if self.position + 1 >= len(self.choices  ):
                      return
                self.position += num_spaces
          else:
                if self.position - 1 < 0:
                      return
                self.position -= num_spaces
          clear_line()
          self.print_choice(__A  )
          move_cursor(__A,direction.name  )
          self.print_choice(self.position  )



    @input.mark(KEYMAP["up"]  )
    def 	lowerCamelCase_	(						self   :							str  ):
          self.move_direction(Direction.UP  )



    @input.mark(KEYMAP["down"]  )
    def 	lowerCamelCase_	(						self   :							Tuple  ):
          self.move_direction(Direction.DOWN  )



    @input.mark(KEYMAP["newline"]  )
    def 	lowerCamelCase_	(						self   :							List[Any]  ):
          move_cursor(len(self.choices  ) - self.position,"DOWN"  )
          return self.position



    @input.mark(KEYMAP["interrupt"]  )
    def 	lowerCamelCase_	(						self   :							List[Any]  ):
          move_cursor(len(self.choices  ) - self.position,"DOWN"  )
          raise KeyboardInterrupt



    @input.mark_multiple(*[KEYMAP[str(__A  )] for number in range(1_0  )]  )
    def 	lowerCamelCase_	(						self   :							Optional[int]  ):
          _lowerCamelCase					: List[str]		    = int(chr(self.current_selection  )  )
          _lowerCamelCase					: int		    = index - self.position
          if index == self.position:
                return
          if index < len(self.choices  ):
                if self.position > index:
                      self.move_direction(Direction.UP,-movement  )
                elif self.position < index:
                      self.move_direction(Direction.DOWN,__A  )
                else:
                      return
          else:
                return



    def 	lowerCamelCase_	(						self   :							Optional[int],__A   :							int = 0  ):
          if self.prompt:
                linebreak()
                forceWrite(self.prompt,"\n"  )
                if in_colab:
                      forceWrite("Please input a choice index (starting from 0), and press enter","\n"  )
                else:
                      forceWrite("Please select a choice using the arrow or number keys, and selecting with enter","\n"  )
          _lowerCamelCase					: List[str]		    = default_choice
          for i in range(len(self.choices  )  ):
                self.print_choice(__A  )
                forceWrite("\n"  )
          move_cursor(len(self.choices  ) - self.position,"UP"  )
          with cursor.hide():
                while True:
                      if in_colab:
                            try:
                                  _lowerCamelCase					: Optional[Any]		    = int(builtins.input()  )
                            except ValueError:
                                  _lowerCamelCase					: int		    = default_choice
                      else:
                            _lowerCamelCase					: Union[str, Any]		    = self.handle_input()
                      if choice is not None:
                            reset_cursor()
                            for _ in range(len(self.choices  ) + 1  ):
                                  move_cursor(1,"UP"  )
                                  clear_line()
                            self.write_choice(__A,"\n"  )
                            return choice







'''simple docstring'''



def 				lowercase_					(     __A			:							int      )							->   int:



 """simple docstring"""




 if n == 1 or not isinstance(__A       ,   __A      ):
  return 0
 elif n == 2:
  return 1
 else:
  lowercase       : Tuple						=[0, 1]
  for i in range(2       ,   n + 1      ):
   sequence.append(sequence[i - 1] + sequence[i - 2]      )

  return sequence[n]


def 				lowercase_					(     __A			:							int      )							->   int:



 """simple docstring"""




 lowercase       : List[str]						=0
 lowercase       : str						=2

 while digits < n:
  index += 1
  lowercase       : int						=len(str(fibonacci(__A      )      )      )

 return index


def 				lowercase_					(     __A			:							int = 1_0_0_0      )							->   int:



 """simple docstring"""




 return fibonacci_digits_index(__A      )


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



