




"""simple docstring"""







lowerCamelCase__        =		[0, 2, 4, 6, 8]
lowerCamelCase__        =		[1, 3, 5, 7, 9]
def    __lowerCAmelCase    (_UpperCamelCase	,  _UpperCamelCase	,  _UpperCamelCase	,  _UpperCamelCase		):
	if remaining_length == 0:
		if digits[0] == 0 or digits[-1] == 0:
			return 0

		for i in range(length // 2 - 1	,  -1	,  -1		):
			remainder += digits[i] + digits[length - i - 1]

			if remainder % 2 == 0:
				return 0

			remainder //= 10

		return 1

	if remaining_length == 1:
		if remainder % 2 == 0:
			return 0

		__lowerCAmelCase      :						Union[str, Any]						      =				0
		for digit in range(10		):
			__lowerCAmelCase      :						str						      =				digit
			result += reversible_numbers(
			    0	,  (remainder + 2 * digit) // 10	,  __lowerCamelCase	,  __lowerCamelCase		)
		return result

	__lowerCAmelCase      :						Optional[int]						      =				0
	for digita in range(10		):
		__lowerCAmelCase      :						Union[str, Any]						      =				digita

		if (remainder + digita) % 2 == 0:
			__lowerCAmelCase      :						List[Any]						      =				ODD_DIGITS
		else:
			__lowerCAmelCase      :						int						      =				EVEN_DIGITS

		for digita in other_parity_digits:
			__lowerCAmelCase      :						int						      =				digita
			result += reversible_numbers(
			    remaining_length - 2	,  (remainder + digita + digita) // 10	,  __lowerCamelCase	,  __lowerCamelCase	,  )
	return result
def    __lowerCAmelCase    (_UpperCamelCase = 9		):
	__lowerCAmelCase      :						Tuple						      =				0
	for length in range(1	,  max_power + 1		):
		result += reversible_numbers(__lowerCamelCase	,  0	,  [0] * length	,  __lowerCamelCase		)
	return result


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

"""simple docstring"""







import os
def    __lowerCAmelCase    (_UpperCamelCase = "input.txt"		):

	with open(os.path.join(os.path.dirname(_UpperCamelCase		)	,  _UpperCamelCase		)		) as input_file:
		__lowerCAmelCase      :						Optional[Any]						      =				[
		    [int(_UpperCamelCase		) for element in line.split(','		)]
		    for line in input_file.readlines()
		]

	__lowerCAmelCase      :						List[str]						      =				len(_UpperCamelCase		)
	__lowerCAmelCase      :						Tuple						      =				len(matrix[0]		)

	__lowerCAmelCase      :						int						      =				[[-1 for _ in range(_UpperCamelCase		)] for _ in range(_UpperCamelCase		)]
	for i in range(_UpperCamelCase		):
		__lowerCAmelCase      :						Any						      =				matrix[i][0]

	for j in range(1	,  _UpperCamelCase		):
		for i in range(_UpperCamelCase		):
			__lowerCAmelCase      :						Optional[Any]						      =				minimal_path_sums[i][j - 1] + matrix[i][j]

		for i in range(1	,  _UpperCamelCase		):
			__lowerCAmelCase      :						Optional[Any]						      =				min(
			    minimal_path_sums[i][j]	,  minimal_path_sums[i - 1][j] + matrix[i][j]		)

		for i in range(rows - 2	,  -1	,  -1		):
			__lowerCAmelCase      :						List[str]						      =				min(
			    minimal_path_sums[i][j]	,  minimal_path_sums[i + 1][j] + matrix[i][j]		)

	return min(minimal_path_sums_row[-1] for minimal_path_sums_row in minimal_path_sums		)


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