"""simple docstring"""




from collections.abc import Callable

import numpy as np







def 							_UpperCAmelCase		(       lowerCamelCase__			,  lowerCamelCase__			,  lowerCamelCase__			,  lowerCamelCase__			,  lowerCamelCase__     ):





		"""simple docstring"""




		lowerCAmelCase__        =   int(np.ceil((x_end - xa) / step_size     )     )
		lowerCAmelCase__        =   np.zeros((n + 1,)     )
		lowerCAmelCase__        =   ya
		lowerCAmelCase__        =   xa

		for k in range(lowerCamelCase__     ):
				lowerCAmelCase__        =   y[k] + step_size * ode_func(lowerCamelCase__			,  y[k]     )
				lowerCAmelCase__        =   y[k] + (
				    (step_size / 2) * (ode_func(lowerCamelCase__			,  y[k]     ) + ode_func(x + step_size			,  lowerCamelCase__     ))
				)
				x += step_size

		return y


if __name__ == "__main__":
			import doctest

			doctest.testmod()





"""simple docstring"""




import os







def 							_UpperCAmelCase		(       ):





		"""simple docstring"""




		lowerCAmelCase__        =   os.path.dirname(os.path.realpath(lowerCamelCase__     )     )
		lowerCAmelCase__        =   os.path.join(lowerCamelCase__			,  """triangle.txt"""     )

		with open(lowerCamelCase__     ) as f:
				lowerCAmelCase__        =   f.readlines()

		lowerCAmelCase__        =   []
		for line in triangle:
				lowerCAmelCase__        =   []
				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__        =   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(lowerCamelCase__			,  lowerCamelCase__     )
		return max(a[-1]     )


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




