
UpperCamelCase_   	=	[sum(int(c, 1_0) ** 2 for c in i.__str__()) for i in range(1_0_0_0_0_0)]






def 		_UpperCAmelCase   (	UpperCamelCase:     int  ):






	"""simple docstring"""


	__lowerCAmelCase         =							0
	while number:
		# Increased Speed Slightly by checking every 5 digits together.
		sum_of_digits_squared += DIGITS_SQUARED[number % 1_0_0_0_0_0]
		number //= 1_0_0_0_0_0

	return sum_of_digits_squared


# There are 2 Chains made,
# One ends with 89 with the chain member 58 being the one which when declared first,
# there will be the least number of iterations for all the members to be checked.

# The other one ends with 1 and has only one element 1.

# So 58 and 1 are chosen to be declared at the starting.

# Changed dictionary to an array to quicken the solution
UpperCamelCase_   	=	[None] * 1_0_0_0_0_0_0_0
UpperCamelCase_   	=	True
UpperCamelCase_   	=	False






def 		_UpperCAmelCase   (	UpperCamelCase:     int  ):






	"""simple docstring"""


	if CHAINS[number - 1] is not None:
		return CHAINS[number - 1]  # type: ignore

	__lowerCAmelCase         =							chain(next_number(UpperCamelCase  )  )
	__lowerCAmelCase         =							number_chain

	while number < 1_0_0_0_0_0_0_0:
		__lowerCAmelCase         =							number_chain
		number *= 1_0

	return number_chain






def 		_UpperCAmelCase   (	UpperCamelCase:     int = 1_0_0_0_0_0_0_0  ):






	"""simple docstring"""


	for i in range(1			,							UpperCamelCase  ):
		if CHAINS[i] is None:
			chain(i + 1  )

	return CHAINS[:number].count(UpperCamelCase  )


if __name__ == "__main__":
					import doctest

					doctest.testmod()
					print(f'''{solution() = }''')








import fire

from utils import calculate_rouge, save_json






def 		_UpperCAmelCase   (	UpperCamelCase:     Any			,							UpperCamelCase:     Union[str, Any]			,							UpperCamelCase:     List[Any]=None			,							**UpperCamelCase:     Optional[int]  ):






	"""simple docstring"""


	__lowerCAmelCase         =							[x.strip() for x in open(UpperCamelCase  ).readlines()]
	__lowerCAmelCase         =							[x.strip() for x in open(UpperCamelCase  ).readlines()][: len(UpperCamelCase  )]
	__lowerCAmelCase         =							calculate_rouge(UpperCamelCase			,							UpperCamelCase			,							**UpperCamelCase  )
	if save_path is not None:
		save_json(UpperCamelCase			,							UpperCamelCase			,							indent=UpperCamelCase  )
	return metrics  # these print nicely


if __name__ == "__main__":
					fire.Fire(calculate_rouge_path)






