





import os



def A_     (		A__ = "input.txt"    )  ->		int:

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

       a__						:     Dict			=    len(A__    )
       a__						:     Tuple			=    len(matrix[0]    )

       a__						:     Any			=    [[-1 for _ in range(A__    )] for _ in range(A__    )]
       for i in range(A__    ):
              a__						:     Any			=    matrix[i][0]

       for j in range(1		,				A__    ):
              for i in range(A__    ):
                     a__						:     Any			=    minimal_path_sums[i][j - 1] + matrix[i][j]

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

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









import enum
import shutil
import sys


lowercase						, lowercase				:	List[Any]      						=  shutil.get_terminal_size()

lowercase				:	Union[str, Any]      						=  {"""UP""": """A""", """DOWN""": """B""", """RIGHT""": """C""", """LEFT""": """D"""}





class 			A__   (							enum.Enum     ):




   """simple docstring"""



   __A       :    List[str]	  =  0
   __A       :    str	  =  1



def A_     (		A__		,				A__=""    )  ->		int:
       sys.stdout.write(str(A__    ) + end    )
       sys.stdout.flush()



def A_     (		A__		,				A__		,				A__=""    )  ->		int:
       forceWrite(F'\u001b[{color}m{content}\u001b[0m'		,				A__    )



def A_     (		)  ->		Any:
       forceWrite('\r'    )



def A_     (		A__		,				A__    )  ->		List[str]:
       forceWrite(F'\033[{num_lines}{CURSOR_TO_CHAR[direction.upper()]}'    )



def A_     (		)  ->		Any:
       forceWrite(' ' * TERMINAL_WIDTH    )
       reset_cursor()



def A_     (		)  ->		Any:
       reset_cursor()
       forceWrite('-' * TERMINAL_WIDTH    )


