/***

    Muammad Imdad-Ul-Haque Rakib(Attari)
    CSE'19
    Chittagong,Bangladesh

***/


#include<bits/stdc++.h>


#define               ek               first
#define               dui              second
#define               ld               long double
#define               ll               long long
#define               boost_           ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define               pb               push_back
#define               ppb              pop_back
#define               ull              unsigned long long
#define               over             return 0
#define               scan(i,n,a)      for(i=0;i<n;++i) cin>>a[i]
#define               MP               make_pair
#define               spc              " "
#define               Yes              cout<<"Yes"<<endl
#define               YES              cout<<"YES"<<endl
#define               yes              cout<<"yes"<<end
#define               No               cout<<"No"<<endl
#define               NO               cout<<"NO"<<endl
#define               no               cout<<"no"<<endl
#define               endl             "\n"
#define               show(i,a)        for(auto i:a) cout<<i<<spc; cout<<endl;
#define               dpoint(n)        cout<<showpoint<<fixed<<setprecision(n);
using namespace std;

int gcd(int x,int y){
    if(!y) return x;
    return gcd(y,x%y);
}
bool sortbysec(const pair<int,int>&a, const pair<int,int>&b){ return (a.second<b.second); }
bool sortbysecinrev(const pair<int,int>&a, const pair<int,int>&b){ return (a.second>b.second); }
bool sortbysize(string &s1,string &s2){ return s1.size() < s2.size(); }
bool sortinrev(const pair<int,int> &a, const pair<int,int> &b){ return (a.first > b.first); }
bool sortcol( const vector<int>& v1, const vector<int>& v2 ) { return v1[0] < v2[0]; }
    /*bool is_prime(ll N){
        ll i,j;
        if(N==1||!N) return false;
        for(i=2;i*i<=N;++i){
            if(N%i==0) return false;
        }
        return true;
    }*/
    /*void sieve(vector<int>&status){
        int i,j,N=10000000;
        //vector<int>status;
        status.assign(N+1,1);
        for(i=4;i<=N;i+=2) status[i]=0;
        for(i=3;i*i<=N;i+=2){
        if(status[i]){ for(j=i*i;j<=N;j+=i) status[j]=0;}
        }
        status[1]=status[0]=0;
        //loop(i,N+1){ if(status[i]) prime.pb(i);}
           // for(i=0;i<prime.size();++i) cout<<prime[i]<<endl;
           // cout<<endl;
    }
    /*void segmented_sieve(ll low,ll high){
        ll i,j,start,cnt=0,N;
        vector<ll>ss;
        for(i=low;i<=high;++i) ss.pb(i);
        loop(i,prime.size()){
            start=prime[i]*prime[i];
            if(start<low) start=((low+prime[i]-1)/prime[i])*prime[i];
            for(j=start;j<=high;j+=prime[i]) ss[j-low]=0;
        }

        if(low==1) ss[0]=0;
        else if(low==0) ss[1]=0;
        loop(i,ss.size()){ if(ss[i]) cout<<ss[i]<<endl; }
        cout<<endl;
    }*/

int proceed(){

    // dpoint(15);

    string a,b;
    cin >> a >> b;
    ll ans=LONG_MAX ,cnt,i,j,k;

    for(i=0;i<=a.size()-b.size();++i){
        cnt=0;
        for(j=0,k=i;j<b.size();++j,++k){
            if(a[k]!=b[j]) ++cnt;
        }
        ans=min(ans,cnt);
    }
    cout << ans << endl;

    over;

}
/** Main **/


int main(){

        boost_;
        int t=1,i=0;
        //cin>>t;
        while(t--){

                    proceed();
        }

        over;
}


Measured memory_bytes: 3652