


import os

def 						_UpperCAmelCase				(			):
     __UpperCamelCase    							=os.path.dirname(os.path.realpath(SCREAMING_SNAKE_CASE__				)				)
     __UpperCamelCase    							=os.path.join(SCREAMING_SNAKE_CASE__			,     'triangle.txt'				)

     with open(SCREAMING_SNAKE_CASE__				) as f:
          __UpperCamelCase    							=f.readlines()

     __UpperCamelCase    							=[]
     for line in triangle:
          __UpperCamelCase    							=[]
          for number in line.strip().split(' '				):
               numbers_from_line.append(int(SCREAMING_SNAKE_CASE__				)				)
          a.append(SCREAMING_SNAKE_CASE__				)

     for i in range(1			,     len(SCREAMING_SNAKE_CASE__				)				):
          for j in range(len(a[i]				)				):
               __UpperCamelCase    							=a[i - 1][j] if j != len(a[i - 1]				) else 0
               __UpperCamelCase    							=a[i - 1][j - 1] if j > 0 else 0
               a[i][j] += max(SCREAMING_SNAKE_CASE__			,     SCREAMING_SNAKE_CASE__				)
     return max(a[-1]				)


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









from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_A		       =						{'configuration_sew': ['SEW_PRETRAINED_CONFIG_ARCHIVE_MAP', 'SEWConfig']}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _A		       =						[
       'SEW_PRETRAINED_MODEL_ARCHIVE_LIST',
       'SEWForCTC',
       'SEWForSequenceClassification',
       'SEWModel',
       'SEWPreTrainedModel',
   ]

if TYPE_CHECKING:
   from .configuration_sew import SEW_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWConfig

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_sew import (
          SEW_PRETRAINED_MODEL_ARCHIVE_LIST,
          SEWForCTC,
          SEWForSequenceClassification,
          SEWModel,
          SEWPreTrainedModel,
      )


else:
   import sys

   _A		       =						_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)





