






__UpperCAmelCase      =				{
    "0": 1,
    "1": 1,
    "2": 2,
    "3": 6,
    "4": 2_4,
    "5": 1_2_0,
    "6": 7_2_0,
    "7": 5_0_4_0,
    "8": 4_0_3_2_0,
    "9": 3_6_2_8_8_0,
}

__UpperCAmelCase      =				{1_4_5: 1_4_5}

__UpperCAmelCase      =				{
    1_4_5: 0,
    1_6_9: 3,
    3_6_3_0_1: 3,
    1_4_5_4: 3,
    8_7_1: 2,
    4_5_3_6_1: 2,
    8_7_2: 2,
}





def 						A_					(						lowercase_			)				->int:







 """simple docstring"""

 if n in CACHE_SUM_DIGIT_FACTORIALS:
  return CACHE_SUM_DIGIT_FACTORIALS[n]
 SCREAMING_SNAKE_CASE				    =		sum(DIGIT_FACTORIALS[let] for let in str(lowercase_			)			)
 SCREAMING_SNAKE_CASE				    =		ret
 return ret





def 						A_					(						lowercase_	,  lowercase_ = None			)				->int:







 """simple docstring"""

 SCREAMING_SNAKE_CASE				    =		previous or set()
 if n in CHAIN_LENGTH_CACHE:
  return CHAIN_LENGTH_CACHE[n]
 SCREAMING_SNAKE_CASE				    =		sum_digit_factorials(lowercase_			)
 if next_number in previous:
  SCREAMING_SNAKE_CASE				    =		0
  return 0
 else:
  previous.add(lowercase_			)
  SCREAMING_SNAKE_CASE				    =		1 + chain_length(lowercase_	,  lowercase_			)
  SCREAMING_SNAKE_CASE				    =		ret
  return ret





def 						A_					(						lowercase_ = 6_0	,  lowercase_ = 1_0_0_0_0_0_0			)				->int:







 """simple docstring"""

 return sum(1 for i in range(1	,  lowercase_			) if chain_length(lowercase_			) == num_terms			)


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






'''simple docstring'''







def       _a		(						_SCREAMING_SNAKE_CASE		: int						,      _SCREAMING_SNAKE_CASE		: int	):
						return (input_a, input_a).count(0	) % 2



def       _a		(						):
						assert xor_gate(0						,      0	) == 0
						assert xor_gate(0						,      1	) == 1
						assert xor_gate(1						,      0	) == 1
						assert xor_gate(1						,      1	) == 0


if __name__ == "__main__":
						print(xor_gate(0, 0))
						print(xor_gate(0, 1))