/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define      inl(x)              scanf("%lld",&x)
#define      in(x)               scanf("%d",&x)
#define      ss(x)               scanf("%s",x)
#define      bitcount            __builtin_popcountll
#define      mxx                 LLONG_MAX
#define      mnn                 LLONG_MIN
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      max_4(a,b,c,d)      max(a,max(b,max(c,d)))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      min_4(a,b,c,d)      min(a,min(b,min(c,d)))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      REV(v)              reverse(v.begin(),v.end())
#define      O(x)                cout<<x<<endl
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      EMB                 emplace_back
#define      MP                  make_pair
#define      PII                 pair<int,int>
#define      MII                 map<int,int>
#define      flash               cout.flush()
#define      InTheNameOfGod      ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
#define dbg(a) cerr << #a << ": "; _print(a); cerr << endl;
#else
#define dbg(a) // No more TLEs
#endif
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;//*(x.find_by_order(i)),x.order_of_key(k)
const ll MOD = 998244353;
constexpr ll mod = 1e9  + 7;
//auto it=std:: unique(v.B,v.E);
//v.resize(std::distance(v.B,it));
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cerr<<a<<endl;
#define bug2(a,b)  cerr<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cerr<<a<<" "<<b<<" "<<c<<endl;
/*----*/
const ll N=2e5+5;
vector<ll> adj[N];
const int NC=10005;
ll inv[NC],fac_inv[NC],fac[NC];
/*----*/
void normal(ll &a) { if (a >= MOD) a %= MOD; (a < 0) && (a += MOD); }
ll modMul(ll a, ll b) {normal(a), normal(b); return (a*b)%MOD; }
ll modAdd(ll a, ll b) {normal(a), normal(b); return (a+b)%MOD; }
ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; } //if MOD is prime, modPow(b, p % (MOD-1))
ll modInverse(ll a) { return modPow(a, MOD-2); }
/*-----*/
ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll modpow(ll a,ll b,ll m){ll ans=1;while(b){if(b&1)ans=(ans*a)%m;b/=2;a=(a*a)%m;}return ans;}
ll binpow(ll a, ll b){ll res = 1;while (b > 0) {if (b & 1)res*=a;a*=a;b>>=1;}return res;}
ll fact(ll num){ll fac=1;while(num!=1){fac=fac*num;num--;}return fac;}
string to_binary(int x) {string s;while(x > 0) {s += (x % 2 ? '1' : '0');x /= 2;}reverse(s.begin(), s.end());return s;}
double quick_pow(double x, ll y){if(!y)  return 1.0;double ans = quick_pow(x,y>>1);ans *= ans;if(y&1)  ans *= x;return ans;}
ll nsum(ll num){return (num*(num+1))/2;}
void edge (ll u,ll v) {adj[u].PSB(v) ;adj[v].PSB(u);}
/*------*/
void initialize()
{
    ll i;
    inv[1]=1;
    for(i=2;i<=NC-2;i++)
        inv[i]=(MOD-MOD/i)*inv[MOD%i]%MOD;
    fac[0]=fac[1]=1;
    for(i=2;i<=NC-2;i++)
        fac[i]=i*fac[i-1]%MOD;
    fac_inv[0]=fac_inv[1]=1;
    for(i=2;i<=NC-2;i++)
        fac_inv[i]=inv[i]*fac_inv[i-1]%MOD;
}
ll ncr(ll n,ll r)
{
    if(n<r) return 0;
    return (fac[n]*fac_inv[r]%MOD)*fac_inv[n-r]%MOD;
}
/*------*/
bool is_prime[N];
V<ll> primes;
void seive(ll n){
    for(ll i=3;i<=n;i+=2) is_prime[i]=true;
    is_prime[2]=true;
    ll lim = sqrt(n);
    primes.push_back(2);
    for(int i = 3; i <= n; i = i + 2){
        if(is_prime[i]){
            primes.push_back(i);
            if(i <= lim){
                for(int j = i * i; j <= n; j = j + 2 * i){
                    is_prime[j] = false;
                }
            }
        }
    }
}
/*-----*/
//exit(0); //fully exit the program.
//return for void // exit from that function.
//return 0 for ll or int // exit from that function.

/*-----*/
void solve(){
   ll n;
   string s,t;
   //seive(n);
   cin>>s>>t;
   ll len=s.length();
   ll ln=t.length();
   ll ans=ln;
   for(ll i=0;i<len-ln+1;i++){
    ll cnt=0;
    for(ll j=0;j<ln;j++){
        if(s[i+j]!=t[j])
            cnt++;
    }
    //bug1(cnt);
    ans=min(ans,cnt);
   }
   cout<<ans<<endl;


   //cout<<fixed<<setprecision(7)<<ans<<endl;
   //cerr <<endl <<"[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;
}
/*-----*/
int main(){
   InTheNameOfGod

   ll Test=1;
   //cin>>Test;
   while(Test--){
     solve();
    }
  loser;
}
///////LeArN & PrAcTiCe MoRe AnD Wait FoR ThE Result///////


Measured memory_bytes: 8328