def levenshtein_distance(s1, s2): n1, n2 = len(s1), len(s2) dp = [[float("inf")]*(n2+1) for _ in range(n1+1)] for i in range(n1 + 1): dp[i][0] = i for j in range(n2 + 1): dp[0][j] = j for i in range(n1): for j in range(n2): # 変更操作 if s1[i] == s2[j]: dp[i + 1][j + 1] = min(dp[i + 1][j + 1], dp[i][j]) else: dp[i + 1][j + 1] = min(dp[i + 1][j + 1], dp[i][j] + 1) # 削除操作 dp[i + 1][j + 1] = min(dp[i + 1][j + 1], dp[i][j + 1] + 1) # 挿入操作 dp[i + 1][j + 1] = min(dp[i + 1][j + 1], dp[i + 1][j] + 1) return (dp[n1][n2], dp) def solve(): s1 = input() s2 = input() opnum, dp = (levenshtein_distance(s1, s2)) print(opnum) N,M=map(int,input().split()) solve()