
'''simple docstring'''



import os
def    lowerCAmelCase_	(				)     ->     int:




   """simple docstring"""
   _SCREAMING_SNAKE_CASE      =				os.path.dirname(os.path.realpath(SCREAMING_SNAKE_CASE_						)						)
   _SCREAMING_SNAKE_CASE      =				os.path.join(SCREAMING_SNAKE_CASE_    ,      """triangle.txt"""						)

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

   _SCREAMING_SNAKE_CASE      =				[]
   for line in triangle:
      _SCREAMING_SNAKE_CASE      =				[]
      for number in line.strip().split(""" """						):
         numbers_from_line.append(int(SCREAMING_SNAKE_CASE_						)						)
      a.append(SCREAMING_SNAKE_CASE_						)

   for i in range(1    ,      len(SCREAMING_SNAKE_CASE_						)						):
      for j in range(len(a[i]						)						):
         _SCREAMING_SNAKE_CASE      =				a[i - 1][j] if j != len(a[i - 1]						) else 0
         _SCREAMING_SNAKE_CASE      =				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'''



UpperCamelCase__      :		Dict       							=  {
    "a": "AAAAA",
    "b": "AAAAB",
    "c": "AAABA",
    "d": "AAABB",
    "e": "AABAA",
    "f": "AABAB",
    "g": "AABBA",
    "h": "AABBB",
    "i": "ABAAA",
    "j": "BBBAA",
    "k": "ABAAB",
    "l": "ABABA",
    "m": "ABABB",
    "n": "ABBAA",
    "o": "ABBAB",
    "p": "ABBBA",
    "q": "ABBBB",
    "r": "BAAAA",
    "s": "BAAAB",
    "t": "BAABA",
    "u": "BAABB",
    "v": "BBBAB",
    "w": "BABAA",
    "x": "BABAB",
    "y": "BABBA",
    "z": "BABBB",
    " ": " ",
}


UpperCamelCase__      :		str       							=  {value: key for key, value in encode_dict.items()}
def    lowerCAmelCase_	(				SCREAMING_SNAKE_CASE_						)     ->     str:




   """simple docstring"""
   _SCREAMING_SNAKE_CASE      =				""""""
   for letter in word.lower():
      if letter.isalpha() or letter == " ":
         encoded += encode_dict[letter]
      else:
         raise Exception("""encode() accepts only letters of the alphabet and spaces"""						)
   return encoded
def    lowerCAmelCase_	(				SCREAMING_SNAKE_CASE_						)     ->     str:




   """simple docstring"""
   if set(SCREAMING_SNAKE_CASE_						) - {"A", "B", " "} != set():
      raise Exception("""decode() accepts only 'A', 'B' and spaces"""						)
   _SCREAMING_SNAKE_CASE      =				""""""
   for word in coded.split():
      while len(SCREAMING_SNAKE_CASE_						) != 0:
         decoded += decode_dict[word[:5]]
         _SCREAMING_SNAKE_CASE      =				word[5:]
      decoded += " "
   return decoded.strip()


if __name__ == "__main__":
     from doctest import testmod

     testmod()






