


from __future__ import annotations

from collections.abc import Callable

snake_case				:    List[Any]       				=     list[list[float | int]]
def 				__lowerCamelCase						( UpperCAmelCase_						:		Matrix ,  UpperCAmelCase_						:		Matrix						):




      """simple docstring"""





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

      for row in range(UpperCAmelCase_						):
            for col in range(UpperCAmelCase_						):
                  a						:Union[str, Any] 							=       matrix[row][col]

            a						:Optional[int] 							=       vector[row][0]

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

            for rowa in range(row + 1 ,  UpperCAmelCase_						):
                  a						:Tuple 							=       augmented[rowa][col] / augmented[row][col]
                  a						:List[str] 							=       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 ,  UpperCAmelCase_						):
            for row in range(UpperCAmelCase_						):
                  a						:Optional[Any] 							=       augmented[row][col] / augmented[col][col]
                  for cola in range(UpperCAmelCase_ ,  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(UpperCAmelCase_						)
      ]
def 				__lowerCamelCase						( UpperCAmelCase_						:		list[int]						):




      """simple docstring"""





      a						:int 							=       len(UpperCAmelCase_						)
      a						:Matrix 							=       [[0 for _ in range(UpperCAmelCase_						)] for _ in range(UpperCAmelCase_						)]
      a						:Matrix 							=       [[0] for _ in range(UpperCAmelCase_						)]
      a						:Matrix
      a						:int
      a						:int
      a						:int

      for x_val, y_val in enumerate(UpperCAmelCase_						):
            for col in range(UpperCAmelCase_						):
                  a						:List[str] 							=       (x_val + 1) ** (size - col - 1)
            a						:Any 							=       y_val

      a						:Optional[int] 							=       solve(UpperCAmelCase_ ,  UpperCAmelCase_						)

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

      return interpolated_func
def 				__lowerCamelCase						( UpperCAmelCase_						:		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						( UpperCAmelCase_						:		Callable[[int], int] = question_function ,  UpperCAmelCase_						:		int = 10						):




      """simple docstring"""





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

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

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

      for poly in polynomials:
            a						:Union[str, Any] 							=       1
            while func(UpperCAmelCase_						) == poly(UpperCAmelCase_						):
                  x_val += 1

            ret += poly(UpperCAmelCase_						)

      return ret


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









def 				__lowerCamelCase						( UpperCAmelCase_						:		int = 1000						):




      """simple docstring"""





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


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





