



import os





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

    with open(_UpperCAmelCase				) as f:
        __a						       =				f.readlines()

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

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


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






"""simple docstring"""






from __future__ import annotations


def 			UpperCAmelCase__       (				lowerCAmelCase__     :list[int]		) ->    int:
      '''simple docstring'''


      if not nums:
            return 0
      lowercase														=	nums[0]
      lowercase														=	0
      for num in nums[1:]:
            lowercase							,							lowercase														=	(
                max_excluding + num,
                max(lowerCAmelCase__					,		lowerCAmelCase__		),
            )
      return max(lowerCAmelCase__					,		lowerCAmelCase__		)


if __name__ == "__main__":
       import doctest

       doctest.testmod()



