WA on 1,4,5,7,8
#include <bits/stdc++.h>
using namespace std;
string A,B;
int l1,l2,f[2005][2005];
int main(){
cin>>A>>B;
l1=A.size();
l2=B.size();
for(int i=0;i<l1;i++)f[i][0]=i;
for(int i=0;i<l2;i++)f[0][i]=i;
for(int i=1;i<l1;i++){
for(int j=1;j<l2;j++){
if(A[i]==B[j])f[i][j]=f[i-1][j-1];
else f[i][j]=min(f[i-1][j-1]+1,min(f[i-1][j]+1,f[i][j-1]+1));
}
}
cout<<f[l1-1][l2-1];
return 0;
}