"""simple docstring"""





def    lowercase_   (   _lowerCamelCase:	Any      ) ->      List[Any]:



							'''simple docstring'''

							__lowerCamelCase   ,  __lowerCamelCase					:		Dict		   =     [], []
							while len(_lowerCAmelCase      ) > 1:
														__lowerCamelCase   ,  __lowerCamelCase					:		Optional[int]		   =     min(_lowerCAmelCase      ), max(_lowerCAmelCase      )
														start.append(_lowerCAmelCase      )
														end.append(_lowerCAmelCase      )
														collection.remove(_lowerCAmelCase      )
														collection.remove(_lowerCAmelCase      )
							end.reverse()
							return start + collection + end


if __name__ == "__main__":
				__A  =				input('''Enter numbers separated by a comma:\n''').strip()
				__A  =				[int(item) for item in user_input.split(''',''')]
				print(*merge_sort(unsorted), sep=''',''')

"""simple docstring"""





import os


def    lowercase_   (   ) ->      List[str]:



							'''simple docstring'''

							__lowerCamelCase					:		Union[str, Any]		   =     os.path.dirname(os.path.realpath(_lowerCamelCase      )      )
							__lowerCamelCase					:		int		   =     os.path.join(_lowerCamelCase						,   "triangle.txt"      )

							with open(_lowerCamelCase      ) as f:
														__lowerCamelCase					:		List[str]		   =     f.readlines()

							__lowerCamelCase					:		List[str]		   =     []
							for line in triangle:
														__lowerCamelCase					:		Optional[int]		   =     []
														for number in line.strip().split(" "      ):
																					numbers_from_line.append(int(_lowerCamelCase      )      )
														a.append(_lowerCamelCase      )

							for i in range(1						,   len(_lowerCamelCase      )      ):
														for j in range(len(a[i]      )      ):
																					__lowerCamelCase					:		int		   =     a[i - 1][j] if j != len(a[i - 1]      ) else 0
																					__lowerCamelCase					:		Union[str, Any]		   =     a[i - 1][j - 1] if j > 0 else 0
																					a[i][j] += max(_lowerCamelCase						,   _lowerCamelCase      )
							return max(a[-1]      )


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