
import os






def 		_UpperCAmelCase   (	UpperCamelCase:     str = "input.txt"  ):






	"""simple docstring"""


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

	__lowerCAmelCase         =							len(UpperCamelCase  )
	__lowerCAmelCase         =							len(matrix[0]  )

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

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

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

		for i in range(rows - 2			,							-1			,							-1  ):
			__lowerCAmelCase         =							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() = }''')








from abc import ABC, abstractmethod
from argparse import ArgumentParser

class       a		(   __UpperCAmelCase					):







							@staticmethod
							@abstractmethod
							def       UpperCAmelCase__					(						snake_case__  :  ArgumentParser ):
								"""simple docstring"""







								raise NotImplementedError()







							@abstractmethod
							def       UpperCAmelCase__					(						self  :  Any ):
								"""simple docstring"""







								raise NotImplementedError()






