



"""simple docstring"""







import os



def   a_	(			):
     A__				=   os.path.dirname(os.path.realpath(__a      )      )
     A__				=   os.path.join(__a		,							'''triangle.txt'''      )

     with open(__a      ) as f:
          A__				=   f.readlines()

     A__				=   [[int(__a      ) for y in x.rstrip('''\r\n'''      ).split(''' '''      )] for x in triangle]

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


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










"""simple docstring"""







from math import factorial



def   a_	(			__a		,							__a      ):
     return factorial(__a      ) / (factorial(__a      ) * factorial(n - r      ))



def   a_	(			):
     A__				=   0

     for i in range(1		,							101      ):
          for j in range(1		,							i + 1      ):
               if combinations(__a		,							__a      ) > 1e6:
                    total += 1
     return total


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



