





import os

def   __snake_case    (       _lowerCAmelCase			:			str = "matrix.txt"						)			->    int:
   with open(os.path.join(os.path.dirname(_lowerCAmelCase						)					,					_lowerCAmelCase						)						) as in_file:
      A_       :					Optional[Any]        =      in_file.read()

   A_       :					List[str]        =      [[int(_lowerCAmelCase						) for cell in row.split(","						)] for row in data.strip().splitlines()]
   A_       :					List[Any]        =      [[0 for cell in row] for row in grid]
   A_       :					Optional[int]        =      len(grid[0]						)

   A_       :					Union[str, Any]        =      [[0 for i in range(_lowerCAmelCase						)] for j in range(_lowerCAmelCase						)]
   A_       :					Union[str, Any]        =      grid[0][0]
   for i in range(1					,					_lowerCAmelCase						):
      A_       :					str        =      grid[0][i] + dp[0][i - 1]
   for i in range(1					,					_lowerCAmelCase						):
      A_       :					int        =      grid[i][0] + dp[i - 1][0]

   for i in range(1					,					_lowerCAmelCase						):
      for j in range(1					,					_lowerCAmelCase						):
         A_       :					List[str]        =      grid[i][j] + min(dp[i - 1][j]					,					dp[i][j - 1]						)

   return dp[-1][-1]


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







def   __snake_case    (       _lowerCAmelCase			:			int						)			->    bool:
   if num < 0:
      return False

   A_       :					int        =      num
   A_       :					int        =      0
   while num > 0:
      A_       :					str        =      rev_num * 10 + (num % 10)
      num //= 10

   return num_copy == rev_num


if __name__ == "__main__":
 import doctest

 doctest.testmod()
