



"""simple docstring"""
from typing import Any


class 							lowerCamelCase_:





					'''simple docstring'''



					def __init__(			self      ):
									_lowerCamelCase					     = []
									_lowerCamelCase					     = 0

					def __str__(			self      ):
									_lowerCamelCase					     = '''<''' + str(self.stack      )[1:-1] + '''>'''
									return printed

					def 	snake_case__					(			self ,				lowerCamelCase__      ):
									self.stack.append(lowerCamelCase__      )
									_lowerCamelCase					     = self.length + 1

					def 	snake_case__					(			self      ):
									self.rotate(1      )
									_lowerCamelCase					     = self.stack[self.length - 1]
									_lowerCamelCase					     = self.stack[:-1]
									self.rotate(self.length - 1      )
									_lowerCamelCase					     = self.length - 1
									return dequeued

					def 	snake_case__					(			self ,				lowerCamelCase__      ):
									for _ in range(lowerCamelCase__      ):
													_lowerCamelCase					     = self.stack[0]
													_lowerCamelCase					     = self.stack[1:]
													self.put(lowerCamelCase__      )
													_lowerCamelCase					     = self.length - 1

					def 	snake_case__					(			self      ):
									_lowerCamelCase					     = self.get()
									self.put(lowerCamelCase__      )
									self.rotate(self.length - 1      )
									return front

					def 	snake_case__					(			self      ):
									return self.length





"""simple docstring"""
def 				lowerCAmelCase_(      lowercase_   :							str  ,      lowercase_   :							str							)		->				int:
				# The longer word should come first
				if len(lowercase_							) < len(lowercase_							):
								return levenshtein_distance(lowercase_  ,      lowercase_							)

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

				_lowerCamelCase					     = list(range(len(lowercase_							) + 1							)							)

				for i, ca in enumerate(lowercase_							):
								_lowerCamelCase					     = [i + 1]

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

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

								# Store the previous row
								_lowerCamelCase					     = current_row

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


if __name__ == "__main__":
			__SCREAMING_SNAKE_CASE     :  int										=					input('''Enter the first word:\n''').strip()
			__SCREAMING_SNAKE_CASE     :  Optional[Any]										=					input('''Enter the second word:\n''').strip()

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