





from __future__ import annotations

import math



class  A__       :





      def __init__(			self	,							A_       ):
       '''simple docstring'''




       UpperCamelCase     : Optional[int]	     =       size
       # approximate the overall size of segment tree with given value
       UpperCamelCase     : Any	     =       [0 for i in range(0	,							4 * size       )]
       # create array to store lazy update
       UpperCamelCase     : Any	     =       [0 for i in range(0	,							4 * size       )]
       UpperCamelCase     : List[Any]	     =       [0 for i in range(0	,							4 * size       )]  # flag for lazy update





      def 	__UpperCamelCase(			self	,							A_       ):
       '''simple docstring'''




       return idx * 2





      def 	__UpperCamelCase(			self	,							A_       ):
       '''simple docstring'''




       return idx * 2 + 1





      def 	__UpperCamelCase(			self	,							A_	,							A_	,							A_	,							A_       ):
       '''simple docstring'''




       if left_element == right_element:
        UpperCamelCase     : Dict	     =       a[left_element - 1]
       else:
        UpperCamelCase     : Any	     =       (left_element + right_element) // 2
        self.build(self.left(A_       )	,							A_	,							A_	,							A_       )
        self.build(self.right(A_       )	,							mid + 1	,							A_	,							A_       )
        UpperCamelCase     : Union[str, Any]	     =       max(
            self.segment_tree[self.left(A_       )]	,							self.segment_tree[self.right(A_       )]       )





      def 	__UpperCamelCase(			self	,							A_	,							A_	,							A_	,							A_	,							A_	,							A_       ):
       '''simple docstring'''




       if self.flag[idx] is True:
        UpperCamelCase     : Optional[Any]	     =       self.lazy[idx]
        UpperCamelCase     : Union[str, Any]	     =       False
        if left_element != right_element:
         UpperCamelCase     : Optional[int]	     =       self.lazy[idx]
         UpperCamelCase     : Any	     =       self.lazy[idx]
         UpperCamelCase     : Any	     =       True
         UpperCamelCase     : str	     =       True

       if right_element < a or left_element > b:
        return True
       if left_element >= a and right_element <= b:
        UpperCamelCase     : Dict	     =       val
        if left_element != right_element:
         UpperCamelCase     : int	     =       val
         UpperCamelCase     : List[Any]	     =       val
         UpperCamelCase     : Any	     =       True
         UpperCamelCase     : Tuple	     =       True
        return True
       UpperCamelCase     : Optional[int]	     =       (left_element + right_element) // 2
       self.update(self.left(A_       )	,							A_	,							A_	,							A_	,							A_	,							A_       )
       self.update(self.right(A_       )	,							mid + 1	,							A_	,							A_	,							A_	,							A_       )
       UpperCamelCase     : List[str]	     =       max(
           self.segment_tree[self.left(A_       )]	,							self.segment_tree[self.right(A_       )]       )
       return True





      def 	__UpperCamelCase(			self	,							A_	,							A_	,							A_	,							A_	,							A_       ):
       '''simple docstring'''




       if self.flag[idx] is True:
        UpperCamelCase     : List[str]	     =       self.lazy[idx]
        UpperCamelCase     : Any	     =       False
        if left_element != right_element:
         UpperCamelCase     : str	     =       self.lazy[idx]
         UpperCamelCase     : List[str]	     =       self.lazy[idx]
         UpperCamelCase     : Dict	     =       True
         UpperCamelCase     : List[str]	     =       True
       if right_element < a or left_element > b:
        return -math.inf
       if left_element >= a and right_element <= b:
        return self.segment_tree[idx]
       UpperCamelCase     : Union[str, Any]	     =       (left_element + right_element) // 2
       UpperCamelCase     : List[str]	     =       self.query(self.left(A_       )	,							A_	,							A_	,							A_	,							A_       )
       UpperCamelCase     : Optional[int]	     =       self.query(self.right(A_       )	,							mid + 1	,							A_	,							A_	,							A_       )
       return max(A_	,							A_       )





      def __str__(			self       ):
       '''simple docstring'''




       return str([self.query(1	,							1	,							self.size	,							A_	,							A_       ) for i in range(1	,							self.size + 1       )]       )


if __name__ == "__main__":
    __lowerCamelCase	:					Optional[Any]			  =					[1, 2, -4, 7, 3, -5, 6, 11, -20, 9, 14, 15, 5, 2, -8]
    __lowerCamelCase	:					Union[str, Any]			  =					15
    __lowerCamelCase	:					str			  =					SegmentTree(size)
    segt.build(1, 1, size, A)
    print(segt.query(1, 1, size, 4, 6))
    print(segt.query(1, 1, size, 7, 11))
    print(segt.query(1, 1, size, 7, 12))
    segt.update(1, 1, size, 1, 3, 111)
    print(segt.query(1, 1, size, 1, 15))
    segt.update(1, 1, size, 7, 8, 235)
    print(segt)







def 		A_    (					_lowerCAmelCase					)						->			int:
 if n == 1 or not isinstance(_lowerCAmelCase							,       _lowerCAmelCase					):
  return 0
 elif n == 2:
  return 1
 else:
  UpperCamelCase     : Optional[Any]	     =       [0, 1]
  for i in range(2							,       n + 1					):
   sequence.append(sequence[i - 1] + sequence[i - 2]					)

  return sequence[n]



def 		A_    (					_lowerCAmelCase					)						->			int:
 UpperCamelCase     : Any	     =       0
 UpperCamelCase     : List[Any]	     =       2

 while digits < n:
  index += 1
  UpperCamelCase     : Union[str, Any]	     =       len(str(fibonacci(_lowerCAmelCase					)					)					)

 return index



def 		A_    (					_lowerCAmelCase = 1000					)						->			int:
 return fibonacci_digits_index(_lowerCAmelCase					)


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