

import os

def    A_  (							a = "matrix.txt"  ):

      """simple docstring"""



      with open(os.path.join(os.path.dirname(a  )					,   a  )  ) as in_file:
            SCREAMING_SNAKE_CASE_				:  Optional[int]           =     in_file.read()

      SCREAMING_SNAKE_CASE_				:  List[str]           =     [[int(a  ) for cell in row.split(','  )] for row in data.strip().splitlines()]
      SCREAMING_SNAKE_CASE_				:  Tuple           =     [[0 for cell in row] for row in grid]
      SCREAMING_SNAKE_CASE_				:  List[Any]           =     len(grid[0]  )

      SCREAMING_SNAKE_CASE_				:  Tuple           =     [[0 for i in range(a  )] for j in range(a  )]
      SCREAMING_SNAKE_CASE_				:  List[Any]           =     grid[0][0]
      for i in range(1					,   a  ):
            SCREAMING_SNAKE_CASE_				:  str           =     grid[0][i] + dp[0][i - 1]
      for i in range(1					,   a  ):
            SCREAMING_SNAKE_CASE_				:  Union[str, Any]           =     grid[i][0] + dp[i - 1][0]

      for i in range(1					,   a  ):
            for j in range(1					,   a  ):
                  SCREAMING_SNAKE_CASE_				:  Union[str, Any]           =     grid[i][j] + min(dp[i - 1][j]					,   dp[i][j - 1]  )

      return dp[-1][-1]


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









from ..utils import DummyObject, requires_backends
class  _A		(  metaclass=__magic_name__):
  SCREAMING_SNAKE_CASE    :      Optional[int]       =  ['''flax''']

  def __init__(				self ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(self ,					['flax']					)

  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)



  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)

class  _A		(  metaclass=__magic_name__):
  SCREAMING_SNAKE_CASE    :      List[str]       =  ['''flax''']

  def __init__(				self ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(self ,					['flax']					)

  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)



  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)

class  _A		(  metaclass=__magic_name__):
  SCREAMING_SNAKE_CASE    :      Any       =  ['''flax''']

  def __init__(				self ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(self ,					['flax']					)

  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)



  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)

class  _A		(  metaclass=__magic_name__):
  SCREAMING_SNAKE_CASE    :      Optional[Any]       =  ['''flax''']

  def __init__(				self ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(self ,					['flax']					)

  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)



  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)

class  _A		(  metaclass=__magic_name__):
  SCREAMING_SNAKE_CASE    :      int       =  ['''flax''']

  def __init__(				self ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(self ,					['flax']					)

  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)



  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)

class  _A		(  metaclass=__magic_name__):
  SCREAMING_SNAKE_CASE    :      List[str]       =  ['''flax''']

  def __init__(				self ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(self ,					['flax']					)

  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)



  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)

class  _A		(  metaclass=__magic_name__):
  SCREAMING_SNAKE_CASE    :      int       =  ['''flax''']

  def __init__(				self ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(self ,					['flax']					)

  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)



  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)

class  _A		(  metaclass=__magic_name__):
  SCREAMING_SNAKE_CASE    :      Any       =  ['''flax''']

  def __init__(				self ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(self ,					['flax']					)

  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)



  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)

class  _A		(  metaclass=__magic_name__):
  SCREAMING_SNAKE_CASE    :      Optional[Any]       =  ['''flax''']

  def __init__(				self ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(self ,					['flax']					)

  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)



  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)

class  _A		(  metaclass=__magic_name__):
  SCREAMING_SNAKE_CASE    :      Dict       =  ['''flax''']

  def __init__(				self ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(self ,					['flax']					)

  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)



  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)

class  _A		(  metaclass=__magic_name__):
  SCREAMING_SNAKE_CASE    :      Any       =  ['''flax''']

  def __init__(				self ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(self ,					['flax']					)

  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)



  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)

class  _A		(  metaclass=__magic_name__):
  SCREAMING_SNAKE_CASE    :      Union[str, Any]       =  ['''flax''']

  def __init__(				self ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(self ,					['flax']					)

  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)



  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)

class  _A		(  metaclass=__magic_name__):
  SCREAMING_SNAKE_CASE    :      Union[str, Any]       =  ['''flax''']

  def __init__(				self ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(self ,					['flax']					)

  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)



  @classmethod
  def  UpperCAmelCase    (				cls ,					*_SCREAMING_SNAKE_CASE ,					**_SCREAMING_SNAKE_CASE					):





        """simple docstring"""







        requires_backends(cls ,					['flax']					)






