




'''simple docstring'''
def 							snake_case_    (  a__						:      str       ,a__						:      str     ):



    """simple docstring"""




    if len(a__     ) < len(a__     ):
        return levenshtein_distance(a__       ,a__     )

    if len(a__     ) == 0:
        return len(a__     )

    __lowercase     							=		list(range(len(a__     ) + 1     )     )

    for i, ca in enumerate(a__     ):
        __lowercase     							=		[i + 1]

        for j, ca in enumerate(a__     ):
            # Calculate insertions, deletions and substitutions
            __lowercase     							=		previous_row[j + 1] + 1
            __lowercase     							=		current_row[j] + 1
            __lowercase     							=		previous_row[j] + (ca != ca)

            # Get the minimum to append to the current row
            current_row.append(min(a__       ,a__       ,a__     )     )

        # Store the previous row
        __lowercase     							=		current_row

    # Returns the last element (distance)
    return previous_row[-1]


if __name__ == "__main__":
  A				: Dict					      =			input("""Enter the first word:\n""").strip()
  A				: Dict					      =			input("""Enter the second word:\n""").strip()

  A				: Union[str, Any]					      =			levenshtein_distance(first_word, second_word)
  print(F"""Levenshtein distance between {first_word} and {second_word} is {result}""")










'''simple docstring'''
import os
def 							snake_case_    (  ):



    """simple docstring"""




    __lowercase     							=		os.path.dirname(os.path.realpath(a__     )     )
    __lowercase     							=		os.path.join(a__       ,"""triangle.txt"""     )

    with open(a__     ) as f:
        __lowercase     							=		f.readlines()

    __lowercase     							=		[[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]     )     ):
            __lowercase     							=		a[i - 1][j] if j != len(a[i - 1]     ) else 0
            __lowercase     							=		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())




