





"""simple docstring"""
import os

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

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

 lowerCAmelCase    				= []
 for line in triangle:
  lowerCAmelCase    				= []
  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]			)			):
   lowerCAmelCase    				= a[i - 1][j] if j != len(a[i - 1]			) else 0
   lowerCAmelCase    				= 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"""
def 		_SCREAMING_SNAKE_CASE			(_UpperCAmelCase					:    str			):
 return " ".join(input_str.split()[::-1]			)


if __name__ == "__main__":
       import doctest

       doctest.testmod()





