





from __future__ import annotations

from enum import Enum

class 						UpperCamelCase__					( lowerCAmelCase_  ):



     '''simple docstring'''

     __snake_case       :      List[str]						      =     24
     __snake_case       :      str						      =     21
     __snake_case       :      List[str]						      =     18
     __snake_case       :      List[Any]						      =     15
     __snake_case       :      List[str]						      =     12
     __snake_case       :      List[str]						      =     9
     __snake_case       :      str						      =     6
     __snake_case       :      Any						      =     3
     __snake_case       :      Any						      =     2
     __snake_case       :      List[str]						      =     1
     __snake_case       :      List[str]						      =     -1
     __snake_case       :      Any						      =     -2
     __snake_case       :      Optional[Any]						      =     -3
     __snake_case       :      int						      =     -6
     __snake_case       :      str						      =     -9
     __snake_case       :      Dict						      =     -12
     __snake_case       :      Optional[Any]						      =     -15
     __snake_case       :      Any						      =     -18
     __snake_case       :      Any						      =     -21
     __snake_case       :      Optional[Any]						      =     -24

class 						UpperCamelCase__					( lowerCAmelCase_  ):



     '''simple docstring'''

     __snake_case       :      Union[str, Any]						      =     8
     __snake_case       :      Dict						      =     7
     __snake_case       :      List[str]						      =     6
     __snake_case       :      Tuple						      =     5
     __snake_case       :      Optional[Any]						      =     4
     __snake_case       :      Optional[Any]						      =     3
     __snake_case       :      str						      =     2
     __snake_case       :      List[Any]						      =     1



def   __lowercase  ( _SCREAMING_SNAKE_CASE					,		_SCREAMING_SNAKE_CASE					,		_SCREAMING_SNAKE_CASE					,		)					->  float:


      '''simple docstring'''


      if isinstance(_SCREAMING_SNAKE_CASE					,		_SCREAMING_SNAKE_CASE      ):
            SCREAMING_SNAKE_CASE						=		SIUnit[known_prefix.lower()]
      if isinstance(_SCREAMING_SNAKE_CASE					,		_SCREAMING_SNAKE_CASE      ):
            SCREAMING_SNAKE_CASE						=		SIUnit[unknown_prefix.lower()]
      SCREAMING_SNAKE_CASE						=		known_amount * (
          10 ** (known_prefix.value - unknown_prefix.value)
      )
      return unknown_amount



def   __lowercase  ( _SCREAMING_SNAKE_CASE					,		_SCREAMING_SNAKE_CASE					,		_SCREAMING_SNAKE_CASE					,		)					->  float:


      '''simple docstring'''


      if isinstance(_SCREAMING_SNAKE_CASE					,		_SCREAMING_SNAKE_CASE      ):
            SCREAMING_SNAKE_CASE						=		BinaryUnit[known_prefix.lower()]
      if isinstance(_SCREAMING_SNAKE_CASE					,		_SCREAMING_SNAKE_CASE      ):
            SCREAMING_SNAKE_CASE						=		BinaryUnit[unknown_prefix.lower()]
      SCREAMING_SNAKE_CASE						=		known_amount * (
          2 ** ((known_prefix.value - unknown_prefix.value) * 10)
      )
      return unknown_amount


if __name__ == "__main__":
      import doctest

      doctest.testmod()









import os



def   __lowercase  ( )					->  int:


      '''simple docstring'''


      SCREAMING_SNAKE_CASE						=		os.path.dirname(os.path.realpath(_SCREAMING_SNAKE_CASE      )      )
      SCREAMING_SNAKE_CASE						=		os.path.join(_SCREAMING_SNAKE_CASE					,		"""triangle.txt"""      )

      with open(_SCREAMING_SNAKE_CASE      ) as in_file:
            SCREAMING_SNAKE_CASE						=		[[int(_SCREAMING_SNAKE_CASE      ) for i in line.split()] for line in in_file]

      while len(_SCREAMING_SNAKE_CASE      ) != 1:
            SCREAMING_SNAKE_CASE						=		triangle.pop()
            SCREAMING_SNAKE_CASE						=		triangle[-1]
            for j in range(len(_SCREAMING_SNAKE_CASE      ) - 1      ):
                  curr_row[j] += max(last_row[j]					,		last_row[j + 1]      )
      return triangle[0][0]


if __name__ == "__main__":
      print(solution())


