





"""simple docstring"""





import os


def    a__       (       ):




		"""simple docstring"""


		UpperCamelCase =						os.path.dirname(os.path.realpath(_SCREAMING_SNAKE_CASE     )     )
		UpperCamelCase =						os.path.join(_SCREAMING_SNAKE_CASE	,						"triangle.txt"     )

		with open(_SCREAMING_SNAKE_CASE     ) as f:
				UpperCamelCase =						f.readlines()

		UpperCamelCase =						[[int(_SCREAMING_SNAKE_CASE     ) for y in x.rstrip("\r\n"     ).split(" "     )] for x in triangle]

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


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









"""simple docstring"""





def 							_lowerCAmelCase   (    UpperCAmelCase  :				int					):


					'''simple docstring'''






					if not isinstance(UpperCAmelCase   ,				UpperCAmelCase					):
										raise ValueError('''double_factorial() only accepts integral values'''					)
					if n < 0:
										raise ValueError('''double_factorial() not defined for negative values'''					)
					return 1 if n <= 1 else n * double_factorial(n - 2					)


if __name__ == "__main__":
				import doctest

				doctest.testmod()


