code: 
  
  
  UpperCAmelCase      :						int    =		{
      "0": 1,
      "1": 1,
      "2": 2,
      "3": 6,
      "4": 24,
      "5": 1_20,
      "6": 7_20,
      "7": 50_40,
      "8": 4_03_20,
      "9": 36_28_80,
  }
  
  UpperCAmelCase      :						Tuple    =		{1_45: 1_45}
  
  UpperCAmelCase      :						Tuple    =		{
      1_45: 0,
      1_69: 3,
      3_63_01: 3,
      14_54: 3,
      8_71: 2,
      4_53_61: 2,
      8_72: 2,
  }
  
  
  
  
  
  
  def   __lowerCamelCase	(       lowerCamelCase__		:	int			):
  
  
  
  
  
  			'''simple docstring'''
  
  
  
  
  			if n in CACHE_SUM_DIGIT_FACTORIALS:
  						return CACHE_SUM_DIGIT_FACTORIALS[n]
  			lowerCamelCase								=     sum(DIGIT_FACTORIALS[let] for let in str(lowerCamelCase__			)			)
  			lowerCamelCase								=     ret
  			return ret
  
  
  
  
  
  
  def   __lowerCamelCase	(       lowerCamelCase__		:	int     ,       lowerCamelCase__		:	set | None = None			):
  
  
  
  
  
  			'''simple docstring'''
  
  
  
  
  			lowerCamelCase								=     previous or set()
  			if n in CHAIN_LENGTH_CACHE:
  						return CHAIN_LENGTH_CACHE[n]
  			lowerCamelCase								=     sum_digit_factorials(lowerCamelCase__			)
  			if next_number in previous:
  						lowerCamelCase								=     0
  						return 0
  			else:
  						previous.add(lowerCamelCase__			)
  						lowerCamelCase								=     1 + chain_length(lowerCamelCase__     ,       lowerCamelCase__			)
  						lowerCamelCase								=     ret
  						return ret
  
  
  
  
  
  
  def   __lowerCamelCase	(       lowerCamelCase__		:	int = 60     ,       lowerCamelCase__		:	int = 1000000			):
  
  
  
  
  
  			'''simple docstring'''
  
  
  
  
  			return sum(1 for i in range(1     ,       lowerCamelCase__			) if chain_length(lowerCamelCase__			) == num_terms			)
  
  
  if __name__ == "__main__":
  					print(f"""{solution() = }""")
  
  
style_context: 
  
  
  import unittest
  
  from cer import CER
  
  
  UpperCAmelCase      :						Union[str, Any]    =		CER()
  
  
  
  
  
  
  
  class 					__lowercase					(       unittest.TestCase     ):
  
  
  
  		"""simple docstring"""
  
  		def 				__A      (   self  )     ->   Optional[int]:
  
  
  
  
  
  
  
  					'''simple docstring'''
  
  
  
  
  
  
  
  					lowerCamelCase								=     ["""White House"""]
  					lowerCamelCase								=     ["""white house"""]
  					# S = 2, D = 0, I = 0, N = 11, CER = 2 / 11
  					lowerCamelCase								=     cer.compute(predictions=A		,			references=A  )
  					self.assertTrue(abs(char_error_rate - 0.1818181818  ) < 1e-6  )
  
  
  
  
  
  
  
  		def 				__A      (   self  )     ->   List[str]:
  
  
  
  
  
  
  
  					'''simple docstring'''
  
  
  
  
  
  
  
  					lowerCamelCase								=     ["""were wolf"""]
  					lowerCamelCase								=     ["""werewolf"""]
  					# S = 0, D = 0, I = 1, N = 9, CER = 1 / 9
  					lowerCamelCase								=     cer.compute(predictions=A		,			references=A  )
  					self.assertTrue(abs(char_error_rate - 0.1111111  ) < 1e-6  )
  
  					lowerCamelCase								=     ["""werewolf"""]
  					lowerCamelCase								=     ["""weae     wolf"""]
  					# S = 1, D = 1, I = 0, N = 8, CER = 0.25
  					lowerCamelCase								=     cer.compute(predictions=A		,			references=A  )
  					self.assertTrue(abs(char_error_rate - 0.25  ) < 1e-6  )
  
  					# consecutive whitespaces case 1
  					lowerCamelCase								=     ["""were wolf"""]
  					lowerCamelCase								=     ["""were               wolf"""]
  					# S = 0, D = 0, I = 0, N = 9, CER = 0
  					lowerCamelCase								=     cer.compute(predictions=A		,			references=A  )
  					self.assertTrue(abs(char_error_rate - 0.0  ) < 1e-6  )
  
  					# consecutive whitespaces case 2
  					lowerCamelCase								=     ["""were   wolf"""]
  					lowerCamelCase								=     ["""were               wolf"""]
  					# S = 0, D = 0, I = 0, N = 9, CER = 0
  					lowerCamelCase								=     cer.compute(predictions=A		,			references=A  )
  					self.assertTrue(abs(char_error_rate - 0.0  ) < 1e-6  )
  
  
  
  
  
  
  
  		def 				__A      (   self  )     ->   str:
  
  
  
  
  
  
  
  					'''simple docstring'''
  
  
  
  
  
  
  
  					lowerCamelCase								=     ["""werewolf"""]
  					lowerCamelCase								=     ["""weaewolf"""]
  					# S = 1, D = 0, I = 0, N = 8, CER = 0.125
  					lowerCamelCase								=     cer.compute(predictions=A		,			references=A  )
  					self.assertTrue(abs(char_error_rate - 0.125  ) < 1e-6  )
  
  
  
  
  
  
  
  		def 				__A      (   self  )     ->   Tuple:
  
  
  
  
  
  
  
  					'''simple docstring'''
  
  
  
  
  
  
  
  					lowerCamelCase								=     ["""werewolf"""]
  					lowerCamelCase								=     ["""wereawolf"""]
  					# S = 0, D = 1, I = 0, N = 8, CER = 0.125
  					lowerCamelCase								=     cer.compute(predictions=A		,			references=A  )
  					self.assertTrue(abs(char_error_rate - 0.125  ) < 1e-6  )
  
  
  
  
  
  
  
  		def 				__A      (   self  )     ->   List[Any]:
  
  
  
  
  
  
  
  					'''simple docstring'''
  
  
  
  
  
  
  
  					lowerCamelCase								=     ["""werewolf"""]
  					lowerCamelCase								=     ["""wereolf"""]
  					# S = 0, D = 0, I = 1, N = 8, CER = 0.125
  					lowerCamelCase								=     cer.compute(predictions=A		,			references=A  )
  					self.assertTrue(abs(char_error_rate - 0.125  ) < 1e-6  )
  
  
  
  
  
  
  
  		def 				__A      (   self  )     ->   Tuple:
  
  
  
  
  
  
  
  					'''simple docstring'''
  
  
  
  
  
  
  
  					lowerCamelCase								=     ["""werewolf"""]
  					lowerCamelCase								=     cer.compute(predictions=A		,			references=A  )
  					self.assertEqual(A		,			0.0  )
  
  
  
  
  
  
  
  		def 				__A      (   self  )     ->   List[str]:
  
  
  
  
  
  
  
  					'''simple docstring'''
  
  
  
  
  
  
  
  					lowerCamelCase								=     ["""werewolf""", """I am your father"""]
  					lowerCamelCase								=     cer.compute(predictions=A		,			references=A  )
  					self.assertEqual(A		,			0.0  )
  
  					lowerCamelCase								=     ["""werewolf""", """I am your father""", """doge"""]
  					lowerCamelCase								=     ["""werxwolf""", """I       am your father""", """doge"""]
  					# S = 1, D = 0, I = 0, N = 28, CER = 1 / 28
  					lowerCamelCase								=     cer.compute(predictions=A		,			references=A  )
  					self.assertTrue(abs(char_error_rate - 0.03571428  ) < 1e-6  )
  
  
  
  
  
  
  
  		def 				__A      (   self  )     ->   List[Any]:
  
  
  
  
  
  
  
  					'''simple docstring'''
  
  
  
  
  
  
  
  					lowerCamelCase								=     ["""My hovercraft""", """is full of eels"""]
  					lowerCamelCase								=     ["""My hovercraft is full""", """ of eels"""]
  					# S = 0, D = 0, I = 2, N = 28, CER = 2 / 28
  					# whitespace at the front of " of eels" will be strip during preporcessing
  					# so need to insert 2 whitespaces
  					lowerCamelCase								=     cer.compute(predictions=A		,			references=A		,			concatenate_texts=A  )
  					self.assertTrue(abs(char_error_rate - 0.071428  ) < 1e-6  )
  
  
  
  
  
  
  
  		def 				__A      (   self  )     ->   Optional[int]:
  
  
  
  
  
  
  
  					'''simple docstring'''
  
  
  
  
  
  
  
  					lowerCamelCase								=     ["""我能吞下玻璃而不伤身体"""]
  					lowerCamelCase								=     [""" 能吞虾玻璃而 不霜身体啦"""]
  					# S = 3, D = 2, I = 0, N = 11, CER = 5 / 11
  					lowerCamelCase								=     cer.compute(predictions=A		,			references=A  )
  					self.assertTrue(abs(char_error_rate - 0.4545454545  ) < 1e-6  )
  
  					lowerCamelCase								=     ["""我能吞下玻璃""", """而不伤身体"""]
  					lowerCamelCase								=     ["""我    能 吞 下 玻 璃""", """而不伤身体"""]
  					# S = 0, D = 5, I = 0, N = 11, CER = 5 / 11
  					lowerCamelCase								=     cer.compute(predictions=A		,			references=A  )
  					self.assertTrue(abs(char_error_rate - 0.454545454545  ) < 1e-6  )
  
  					lowerCamelCase								=     ["""我能吞下玻璃而不伤身体"""]
  					lowerCamelCase								=     cer.compute(predictions=A		,			references=A  )
  					self.assertFalse(A		,			0.0  )
  
  
  
  
  
  
  
  		def 				__A      (   self  )     ->   Optional[int]:
  
  
  
  
  
  
  
  					'''simple docstring'''
  
  
  
  
  
  
  
  					lowerCamelCase								=     [""""""]
  					lowerCamelCase								=     ["""Hypothesis"""]
  					with self.assertRaises(A  ):
  								cer.compute(predictions=A		,			references=A  )
  
  
  if __name__ == "__main__":
  		unittest.main()
  
  