


import os
def      UpperCAmelCase__		(UpperCamelCase_ = "matrix.txt"							):



     """simple docstring"""






     with open(os.path.join(os.path.dirname(UpperCamelCase_							)				,UpperCamelCase_							)							) as in_file:
          snake_case											=							in_file.read()

     snake_case											=							[[int(UpperCamelCase_							) for cell in row.split(''','''							)] for row in data.strip().splitlines()]
     snake_case											=							[[0 for cell in row] for row in grid]
     snake_case											=							len(grid[0]							)

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

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

     return dp[-1][-1]


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








class     A__   :







    """simple docstring"""

    def __init__(			self     ,   __snake_case       ):
         snake_case											=							n
         snake_case											=							[None] * self.n
         snake_case											=							0  # index of the first element
         snake_case											=							0
         snake_case											=							0
    def __len__(			self       ):
         return self.size
    def 						a_     (			self       ):
         return self.size == 0
    def 						a_     (			self       ):
         return False if self.is_empty() else self.array[self.front]
    def 						a_     (			self     ,   __snake_case       ):
         if self.size >= self.n:
              raise Exception('''QUEUE IS FULL'''       )

         snake_case											=							data
         snake_case											=							(self.rear + 1) % self.n
         self.size += 1
         return self




    def 						a_     (			self       ):
         if self.size == 0:
              raise Exception('''UNDERFLOW'''       )

         snake_case											=							self.array[self.front]
         snake_case											=							None
         snake_case											=							(self.front + 1) % self.n
         self.size -= 1
         return temp




