


'''simple docstring'''
def       _lowercase							(					UpperCamelCase__							:       int,					UpperCamelCase__							:       list[int],					UpperCamelCase__							:       int      ):

 def count_of_possible_combinations(UpperCamelCase__							:       int      ) -> int:
  if target < 0:
   return 0
  if target == 0:
   return 1
  return sum(count_of_possible_combinations(target - item      ) for item in array      )

 return count_of_possible_combinations(UpperCamelCase__      )


def       _lowercase							(					UpperCamelCase__							:       int,					UpperCamelCase__							:       list[int],					UpperCamelCase__							:       int      ):

 def count_of_possible_combinations_with_dp_array(
     UpperCamelCase__							:       int,					UpperCamelCase__							:       list[int]      ) -> int:
  if target < 0:
   return 0
  if target == 0:
   return 1
  if dp_array[target] != -1:
   return dp_array[target]
  __A	:		List[str]	  =      sum(
      count_of_possible_combinations_with_dp_array(target - item,					UpperCamelCase__      )
      for item in array      )
  __A	:		Dict	  =      answer
  return answer

 __A	:		int	  =      [-1] * (target + 1)
 return count_of_possible_combinations_with_dp_array(UpperCamelCase__,					UpperCamelCase__      )


def       _lowercase							(					UpperCamelCase__							:       int,					UpperCamelCase__							:       list[int],					UpperCamelCase__							:       int      ):
 __A	:		List[str]	  =      [0] * (target + 1)
 __A	:		Union[str, Any]	  =      1

 for i in range(1,					target + 1      ):
  for j in range(UpperCamelCase__      ):
   if i - array[j] >= 0:
    dp_array[i] += dp_array[i - array[j]]

 return dp_array[target]


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 UpperCAmelCase_			:  List[str]										=   3
 UpperCAmelCase_			:  str										=   5
 UpperCAmelCase_			:  List[str]										=   [1, 2, 5]
 print(combination_sum_iv(n, array, target))










'''simple docstring'''
from math import factorial

UpperCAmelCase_			:  List[str]										=   {str(d): factorial(d) for d in range(1_0)}


def       _lowercase							(					UpperCamelCase__							:       int      ):
 return sum(DIGIT_FACTORIAL[d] for d in str(UpperCamelCase__      )      )


def       _lowercase							(					):
 __A	:		Union[str, Any]	  =      7 * factorial(9      ) + 1
 return sum(i for i in range(3,					UpperCamelCase__      ) if sum_of_digit_factorial(UpperCamelCase__      ) == i      )


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






