



from __future__ import annotations

from collections.abc import Callable

__snake_case    :		Dict  =list[list[float | int]]






def      lowerCAmelCase__		(   lowerCamelCase_		:		Matrix	,lowerCamelCase_		:		Matrix):





				'''simple docstring'''

				lowerCAmelCase__					:    int												=					len(lowerCamelCase_)
				lowerCAmelCase__					:    Matrix												=					[[0 for _ in range(size + 1)] for _ in range(lowerCamelCase_)]
				lowerCAmelCase__					:    int
				lowerCAmelCase__					:    int
				lowerCAmelCase__					:    int
				lowerCAmelCase__					:    int
				lowerCAmelCase__					:    int
				lowerCAmelCase__					:    float

				for row in range(lowerCamelCase_):
								for col in range(lowerCamelCase_):
												lowerCAmelCase__					:    int												=					matrix[row][col]

								lowerCAmelCase__					:    List[str]												=					vector[row][0]

				lowerCAmelCase__					:    Tuple												=					0
				lowerCAmelCase__					:    Optional[Any]												=					0
				while row < size and col < size:
								# pivoting
								lowerCAmelCase__					:    Dict												=					max((abs(augmented[rowa][col]), rowa) for rowa in range(lowerCamelCase_	,lowerCamelCase_))[
								    1
								]
								if augmented[pivot_row][col] == 0:
												col += 1
												continue
								else:
												lowerCAmelCase__						,		lowerCAmelCase__					:    Dict												=					augmented[pivot_row], augmented[row]

								for rowa in range(row + 1	,lowerCamelCase_):
												lowerCAmelCase__					:    str												=					augmented[rowa][col] / augmented[row][col]
												lowerCAmelCase__					:    Union[str, Any]												=					0
												for cola in range(col + 1	,size + 1):
																augmented[rowa][cola] -= augmented[row][cola] * ratio

								row += 1
								col += 1

				# back substitution
				for col in range(1	,lowerCamelCase_):
								for row in range(lowerCamelCase_):
												lowerCAmelCase__					:    Union[str, Any]												=					augmented[row][col] / augmented[col][col]
												for cola in range(lowerCamelCase_	,size + 1):
																augmented[row][cola] -= augmented[col][cola] * ratio

    # round to get rid of numbers like 2.000000000000004
				return [
				    [round(augmented[row][size] / augmented[row][row]	,10)] for row in range(lowerCamelCase_)
				]






def      lowerCAmelCase__		(   lowerCamelCase_		:		list[int]):





				'''simple docstring'''

				lowerCAmelCase__					:    int												=					len(lowerCamelCase_)
				lowerCAmelCase__					:    Matrix												=					[[0 for _ in range(lowerCamelCase_)] for _ in range(lowerCamelCase_)]
				lowerCAmelCase__					:    Matrix												=					[[0] for _ in range(lowerCamelCase_)]
				lowerCAmelCase__					:    Matrix
				lowerCAmelCase__					:    int
				lowerCAmelCase__					:    int
				lowerCAmelCase__					:    int

				for x_val, y_val in enumerate(lowerCamelCase_):
								for col in range(lowerCamelCase_):
												lowerCAmelCase__					:    List[Any]												=					(x_val + 1) ** (size - col - 1)
								lowerCAmelCase__					:    int												=					y_val

				lowerCAmelCase__					:    Optional[Any]												=					solve(lowerCamelCase_	,lowerCamelCase_)

				def interpolated_func(lowerCamelCase_		:		int) -> int:
								return sum(
								    round(coeffs[x_val][0]) * (var ** (size - x_val - 1))
								    for x_val in range(lowerCamelCase_))

				return interpolated_func






def      lowerCAmelCase__		(   lowerCamelCase_		:		int):





				'''simple docstring'''

				return (
				    1
				    - variable
				    + variable**2
				    - variable**3
				    + variable**4
				    - variable**5
				    + variable**6
				    - variable**7
				    + variable**8
				    - variable**9
				    + variable**10
				)






def      lowerCAmelCase__		(   lowerCamelCase_		:		Callable[[int], int] = question_function	,lowerCamelCase_		:		int = 10):





				'''simple docstring'''

				lowerCAmelCase__					:    list[int]												=					[func(lowerCamelCase_) for x_val in range(1	,order + 1)]

				lowerCAmelCase__					:    list[Callable[[int], int]]												=					[
				    interpolate(data_points[:max_coeff]) for max_coeff in range(1	,order + 1)
				]

				lowerCAmelCase__					:    int												=					0
				lowerCAmelCase__					:    Callable[[int], int]
				lowerCAmelCase__					:    int

				for poly in polynomials:
								lowerCAmelCase__					:    str												=					1
								while func(lowerCamelCase_) == poly(lowerCamelCase_):
												x_val += 1

								ret += poly(lowerCamelCase_)

				return ret


if __name__ == "__main__":
							print(f"""{solution() = }""")






def      lowerCAmelCase__		(   lowerCamelCase_		:		int = 1000):





				'''simple docstring'''

				lowerCAmelCase__						,		lowerCAmelCase__					:    int												=					1, 1
				lowerCAmelCase__					:    Any												=					2
				while True:
								lowerCAmelCase__					:    Optional[Any]												=					0
								lowerCAmelCase__					:    Any												=					fa + fa
								lowerCAmelCase__						,		lowerCAmelCase__					:    Optional[Any]												=					fa, f
								index += 1
								for _ in str(lowerCamelCase_):
												i += 1
								if i == n:
												break
				return index


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

