"""simple docstring"""





import os


def    lowercase_   (   _lowerCamelCase:	str = "input.txt"      ) ->      int:



							'''simple docstring'''

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

							__lowerCamelCase					:		List[str]							   =     len(_lowerCamelCase      )
							__lowerCamelCase					:		Optional[int]							   =     len(matrix[0]      )

							__lowerCamelCase					:		Optional[Any]							   =     [[-1 for _ in range(_lowerCamelCase      )] for _ in range(_lowerCamelCase      )]
							for i in range(_lowerCamelCase      ):
														__lowerCamelCase					:		Optional[Any]							   =     matrix[i][0]

							for j in range(1						,   _lowerCamelCase      ):
														for i in range(_lowerCamelCase      ):
																					__lowerCamelCase					:		str							   =     minimal_path_sums[i][j - 1] + matrix[i][j]

														for i in range(1						,   _lowerCamelCase      ):
																					__lowerCamelCase					:		Tuple							   =     min(
																					    minimal_path_sums[i][j]						,   minimal_path_sums[i - 1][j] + matrix[i][j]      )

														for i in range(rows - 2						,   -1						,   -1      ):
																					__lowerCamelCase					:		Tuple							   =     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() = }""")
"""simple docstring"""





import copy
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, Optional, Union
@dataclass
class  _snake_case     :
						snake_case__			  =			None
						snake_case__			  =			False
						snake_case__			  =			False
						snake_case__			  =			False
						snake_case__			  =			None
						snake_case__			  =			None
						snake_case__			  =			False
						snake_case__			  =			False
						snake_case__			  =			False
						snake_case__			  =			True
						snake_case__			  =			None
						snake_case__			  =			1
						snake_case__			  =			None
						snake_case__			  =			False
						snake_case__			  =			None
						snake_case__			  =			None






						def       lowerCamelCase__     (       self      :			Any    ):
													return self.__class__(**{k: copy.deepcopy(UpperCAmelCase    ) for k, v in self.__dict__.items()}    )