

"""simple docstring"""






import os
def       UpperCamelCase					(			)				->			List[str]:
 _UpperCAmelCase    :							Tuple									=					os.path.dirname(os.path.realpath(_UpperCAmelCase ) )
 _UpperCAmelCase    :							Optional[Any]									=					os.path.join(_UpperCAmelCase,  """triangle.txt""" )

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

 _UpperCAmelCase    :							List[str]									=					[[int(_UpperCAmelCase ) for y in x.rstrip("""\r\n""" ).split(""" """ )] for x in triangle]

 for i in range(1,  len(_UpperCAmelCase ) ):
  for j in range(len(a[i] ) ):
   _UpperCAmelCase    :							Optional[Any]									=					a[i - 1][j] if j != len(a[i - 1] ) else 0
   _UpperCAmelCase    :							Any									=					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"""






import safs






class     _UpperCAmelCase			(		safs.SaFileSystem):
			pass





