'''simple docstring'''

import os







def      UpperCamelCase_						(					snake_case_       :       str = "matrix.txt"      )					->     int:






 '''simple docstring'''

 with open(os.path.join(os.path.dirname(snake_case_      )						,		snake_case_      )      ) as in_file:
  __lowerCAmelCase											=						in_file.read()

 __lowerCAmelCase											=						[[int(snake_case_      ) for cell in row.split(""","""      )] for row in data.strip().splitlines()]
 __lowerCAmelCase											=						[[0 for cell in row] for row in grid]
 __lowerCAmelCase											=						len(grid[0]      )

 __lowerCAmelCase											=						[[0 for i in range(snake_case_      )] for j in range(snake_case_      )]
 __lowerCAmelCase											=						grid[0][0]
 for i in range(1						,		snake_case_      ):
  __lowerCAmelCase											=						grid[0][i] + dp[0][i - 1]
 for i in range(1						,		snake_case_      ):
  __lowerCAmelCase											=						grid[i][0] + dp[i - 1][0]

 for i in range(1						,		snake_case_      ):
  for j in range(1						,		snake_case_      ):
   __lowerCAmelCase											=						grid[i][j] + min(dp[i - 1][j]						,		dp[i][j - 1]      )

 return dp[-1][-1]


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







'''simple docstring'''

from abc import ABC, abstractmethod
from argparse import ArgumentParser







class 				_lowercase     (				UpperCAmelCase__			):


 '''simple docstring'''






 @staticmethod
 @abstractmethod
 def a					(      SCREAMING_SNAKE_CASE__   :	ArgumentParser							)  ->    Tuple:
  raise NotImplementedError()





 @abstractmethod
 def a					(      self   :	int							)  ->    Union[str, Any]:
  raise NotImplementedError()






