//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main(){
  ll n,k;cin>>n>>k;
  cout<<n-k+1<<endl;
}
#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>

#define rep(index,max) for(int index=0;index<max;index++)

using namespace std;

int main(){
    string s1,s2;
    int l1,l2;
    cin>>s1>>s2;
    l1=s1.length();
    l2=s2.length();
    int dp[1010][1010];
    
    rep(i,l1+1) dp[i][0]=i;
    rep(j,l2+1) dp[0][j]=j;
    
    rep(i,l1){
        rep(j,l2){
            if(s1[i]==s2[j]){
                dp[i+1][j+1]=dp[i][j];
            }
            else{
                dp[i+1][j+1]=min(min(dp[i+1][j],dp[i][j+1]),dp[i][j])+1;
            }
        }
    }
    
    cout<<dp[l1][l2]<<endl;
    return 0;
}