





"""simple docstring"""


import os





def 							a__			(  )    ->  List[Any]:

 '''simple docstring'''






 snake_case__    							=				os.path.dirname(os.path.realpath(_UpperCAmelCase	)	)
 snake_case__    							=				os.path.join(_UpperCAmelCase	,     "triangle.txt"	)

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

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

 for i in range(1	,     len(_UpperCAmelCase	)	):
  for j in range(len(a[i]	)	):
   snake_case__    							=				a[i - 1][j] if j != len(a[i - 1]	) else 0
   snake_case__    							=				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 							a__			(  _UpperCAmelCase	)    ->  int:

 '''simple docstring'''






 return int(_UpperCAmelCase	) if x - int(_UpperCAmelCase	) <= 0 else int(_UpperCAmelCase	) + 1


if __name__ == "__main__":
   import doctest

   doctest.testmod()

