



lowercase_  =   {
    """0""": 1,
    """1""": 1,
    """2""": 2,
    """3""": 6,
    """4""": 24,
    """5""": 120,
    """6""": 720,
    """7""": 5040,
    """8""": 4_0320,
    """9""": 36_2880,
}

lowercase_  =   {145: 145}

lowercase_  =   {
    145: 0,
    169: 3,
    3_6301: 3,
    1454: 3,
    871: 2,
    4_5361: 2,
    872: 2,
}



def __lowerCAmelCase       (   SCREAMING_SNAKE_CASE_     ):
			if n in CACHE_SUM_DIGIT_FACTORIALS:
						return CACHE_SUM_DIGIT_FACTORIALS[n]
			lowercase__         = sum(DIGIT_FACTORIALS[let] for let in str(SCREAMING_SNAKE_CASE__     )     )
			lowercase__         = ret
			return ret



def __lowerCAmelCase       (   SCREAMING_SNAKE_CASE_  ,     SCREAMING_SNAKE_CASE_ = None     ):
			lowercase__         = previous or set()
			if n in CHAIN_LENGTH_CACHE:
						return CHAIN_LENGTH_CACHE[n]
			lowercase__         = sum_digit_factorials(SCREAMING_SNAKE_CASE__     )
			if next_number in previous:
						lowercase__         = 0
						return 0
			else:
						previous.add(SCREAMING_SNAKE_CASE__     )
						lowercase__         = 1 + chain_length(SCREAMING_SNAKE_CASE__  ,     SCREAMING_SNAKE_CASE__     )
						lowercase__         = ret
						return ret



def __lowerCAmelCase       (   SCREAMING_SNAKE_CASE_ = 60  ,     SCREAMING_SNAKE_CASE_ = 100_0000     ):
			return sum(1 for i in range(1  ,     SCREAMING_SNAKE_CASE__     ) if chain_length(SCREAMING_SNAKE_CASE__     ) == num_terms     )


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








def       UpperCamelCase__     (  SCREAMING_SNAKE_CASE__ = 100						):
 __lowerCamelCase		:							List[Any]							=						[[0 for _ in range(SCREAMING_SNAKE_CASE__						)] for _ in range(m + 1						)]
 for i in range(m + 1						):
  __lowerCamelCase		:							Any							=						1

 for n in range(m + 1						):
  for k in range(1			,       SCREAMING_SNAKE_CASE__						):
   memo[n][k] += memo[n][k - 1]
   if n > k:
    memo[n][k] += memo[n - k - 1][k]

 return memo[m][m - 1] - 1


if __name__ == "__main__":
       print(solution(int(input('Enter a number: ').strip())))

