#include using namespace std; using ll = long long; const int INF = 1<<29; int main() { string S, T; cin >> S >> T; int a = 0; cin >> a >> a; int N = max(S.size(),T.size()); vector > dp(1+S.size(),vector(1+T.size(),INF)); dp.at(0).at(0) = 0; for (size_t i = 0; i < S.size(); i++) { for (size_t j = 0; j < T.size(); j++) { if(S.at(i) == T.at(j)){ dp.at(i+1).at(j+1) = dp.at(i).at(j); } else { dp.at(i+1).at(j+1) = min(dp.at(i).at(j)+1,min(dp.at(i).at(j+1)+1,dp.at(i+1).at(j)+1)); } } } cout << dp.at(S.size()).at(T.size()) << endl; return 0; }