






import os





def 				snake_case  (     ):




	'''simple docstring'''







	__lowercase             =  os.path.dirname(os.path.realpath(lowerCamelCase					)					)
	__lowercase             =  os.path.join(lowerCamelCase				,  """triangle.txt"""					)

	with open(lowerCamelCase					) as f:
		__lowercase             =  f.readlines()

	__lowercase             =  []
	for line in triangle:
		__lowercase             =  []
		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]					)					):
			__lowercase             =  a[i - 1][j] if j != len(a[i - 1]					) else 0
			__lowercase             =  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())









from __future__ import annotations





def 				snake_case  (     lowerCamelCase					):




	'''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()

