



from __future__ import annotations

import math







class 				_a				:

			def __init__(self,   SCREAMING_SNAKE_CASE_					)       ->   None:
						UpperCAmelCase_:		List[Any]							      =     size
						# approximate the overall size of segment tree with given value
						UpperCAmelCase_:		Optional[int]							      =     [0 for i in range(0,   4 * size					)]
						# create array to store lazy update
						UpperCAmelCase_:		str							      =     [0 for i in range(0,   4 * size					)]
						UpperCAmelCase_:		Dict							      =     [0 for i in range(0,   4 * size					)]  # flag for lazy update

			def      __snake_case       (self,   SCREAMING_SNAKE_CASE_					)       ->   int:
						return idx * 2

			def      __snake_case       (self,   SCREAMING_SNAKE_CASE_					)       ->   int:
						return idx * 2 + 1

			def      __snake_case       (self,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_					)       ->   None:
						if left_element == right_element:
									UpperCAmelCase_:		int							      =     a[left_element - 1]
						else:
									UpperCAmelCase_:		str							      =     (left_element + right_element) // 2
									self.build(self.left(SCREAMING_SNAKE_CASE_					),   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_					)
									self.build(self.right(SCREAMING_SNAKE_CASE_					),   mid + 1,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_					)
									UpperCAmelCase_:		str							      =     max(
									    self.segment_tree[self.left(SCREAMING_SNAKE_CASE_					)],   self.segment_tree[self.right(SCREAMING_SNAKE_CASE_					)]					)

			def      __snake_case       (self,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_					)       ->   bool:
						if self.flag[idx] is True:
									UpperCAmelCase_:		int							      =     self.lazy[idx]
									UpperCAmelCase_:		Optional[int]							      =     False
									if left_element != right_element:
												UpperCAmelCase_:		List[Any]							      =     self.lazy[idx]
												UpperCAmelCase_:		Optional[Any]							      =     self.lazy[idx]
												UpperCAmelCase_:		Union[str, Any]							      =     True
												UpperCAmelCase_:		List[Any]							      =     True

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

			def      __snake_case       (self,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_					)       ->   int | float:
						if self.flag[idx] is True:
									UpperCAmelCase_:		List[Any]							      =     self.lazy[idx]
									UpperCAmelCase_:		Dict							      =     False
									if left_element != right_element:
												UpperCAmelCase_:		Optional[int]							      =     self.lazy[idx]
												UpperCAmelCase_:		Any							      =     self.lazy[idx]
												UpperCAmelCase_:		List[str]							      =     True
												UpperCAmelCase_:		Union[str, Any]							      =     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_:		int							      =     (left_element + right_element) // 2
						UpperCAmelCase_:		Dict							      =     self.query(self.left(SCREAMING_SNAKE_CASE_					),   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_					)
						UpperCAmelCase_:		Optional[int]							      =     self.query(self.right(SCREAMING_SNAKE_CASE_					),   mid + 1,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_					)
						return max(SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_					)

			def __str__(self					)       ->   str:
						return str([self.query(1,   1,   self.size,   SCREAMING_SNAKE_CASE_,   SCREAMING_SNAKE_CASE_					) for i in range(1,   self.size + 1					)]					)


if __name__ == "__main__":
	a      :  str			     =			[1, 2, -4, 7, 3, -5, 6, 11, -20, 9, 14, 15, 5, 2, -8]
	a      :  Optional[Any]			     =			15
	a      :  Tuple			     =			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  lowerCAmelCase_	(lowerCAmelCase__:		int  ):





			"""simple docstring"""


			if n == 1 or not isinstance(lowerCAmelCase__		,						lowerCAmelCase__  ):
						return 0
			elif n == 2:
						return 1
			else:
						UpperCAmelCase_:		Optional[int]							      =     [0, 1]
						for i in range(2		,						n + 1  ):
									sequence.append(sequence[i - 1] + sequence[i - 2]  )

						return sequence[n]







def  lowerCAmelCase_	(lowerCAmelCase__:		int  ):





			"""simple docstring"""


			UpperCAmelCase_:		str							      =     0
			UpperCAmelCase_:		str							      =     2

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

			return index







def  lowerCAmelCase_	(lowerCAmelCase__:		int = 1_0_0_0  ):





			"""simple docstring"""


			return fibonacci_digits_index(lowerCAmelCase__  )


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






