import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);		
		String s = sc.next();
        String t = sc.next();
        int ans = t.length();
        for(int i=0;i<=s.length()-t.length();i++){int count = t.length();
                                         for(int j=0;j<t.length();j++){if(s.charAt(i+j)==t.charAt(j)){count--;}                              
                                                                      }
                            ans=Math.min(ans,count);
                                        }        
		System.out.println(ans);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);		
		String s = sc.next();
        String t = sc.next();
        int ans = t.length();
        for(int i=0;i<=s.length()-t.length();i++){int count = t.length();
                                         for(int j=0;j<t.length();j++){if(s.charAt(i+j)==t.charAt(j)){count--;}                              
                                                                      }
                            ans=Math.min(ans,count);
                                        }        
		System.out.println(ans);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);		
		String s = sc.next();
        String t = sc.next();
        int ans = t.length();
        for(int i=0;i<=s.length()-t.length();i++){int count = t.length();
                                         for(int j=0;j<t.length();j++){if(s.charAt(i+j)==t.charAt(j)){count--;}                              
                                                                      }
                            ans=Math.min(ans,count);
                                        }        
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);		
		String s = sc.next();
        String t = sc.next();
        int ans = t.length();
        for(int i=0;i<=s.length()-t.length();i++){int count = t.length();
                                         for(int j=0;j<t.length();j++){if(s.charAt(i+j)==t.charAt(j)){count--;}                              
                                                                      }
                            ans=Math.min(ans,count);
                                        }        
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String t = sc.next(); t sc.next() sc.next sc int ans = t.length(); ans t.length() t.length t for(int i=0;i<=s.length()-t.length();i++){int count = t.length();
                                         for(int j=0;j<t.length();j++){if(s.charAt(i+j)==t.charAt(j)){count--;}                              
                                                                      }
                            ans=Math.min(ans,count);
                                        } int i=0; int i=0; i 0 i<=s.length()-t.length() i s.length()-t.length() s.length() s.length s t.length() t.length t i++ i++ i {int count = t.length();
                                         for(int j=0;j<t.length();j++){if(s.charAt(i+j)==t.charAt(j)){count--;}                              
                                                                      }
                            ans=Math.min(ans,count);
                                        } {int count = t.length();
                                         for(int j=0;j<t.length();j++){if(s.charAt(i+j)==t.charAt(j)){count--;}                              
                                                                      }
                            ans=Math.min(ans,count);
                                        } int count = t.length(); count t.length() t.length t for(int j=0;j<t.length();j++){if(s.charAt(i+j)==t.charAt(j)){count--;}                              
                                                                      } int j=0; int j=0; j 0 j<t.length() j t.length() t.length t j++ j++ j {if(s.charAt(i+j)==t.charAt(j)){count--;}                              
                                                                      } {if(s.charAt(i+j)==t.charAt(j)){count--;}                              
                                                                      } if(s.charAt(i+j)==t.charAt(j)){count--;} s.charAt(i+j)==t.charAt(j) s.charAt(i+j) s.charAt s i+j i j t.charAt(j) t.charAt t j {count--;} count-- count ans=Math.min(ans,count) ans Math.min(ans,count) Math.min Math ans count System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);		
		String s = sc.next();
        String t = sc.next();
        int ans = t.length();
        for(int i=0;i<=s.length()-t.length();i++){int count = t.length();
                                         for(int j=0;j<t.length();j++){if(s.charAt(i+j)==t.charAt(j)){count--;}                              
                                                                      }
                            ans=Math.min(ans,count);
                                        }        
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);		
		String s = sc.next();
        String t = sc.next();
        int ans = t.length();
        for(int i=0;i<=s.length()-t.length();i++){int count = t.length();
                                         for(int j=0;j<t.length();j++){if(s.charAt(i+j)==t.charAt(j)){count--;}                              
                                                                      }
                            ans=Math.min(ans,count);
                                        }        
		System.out.println(ans);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);		
		String s = sc.next();
        String t = sc.next();
        int ans = t.length();
        for(int i=0;i<=s.length()-t.length();i++){int count = t.length();
                                         for(int j=0;j<t.length();j++){if(s.charAt(i+j)==t.charAt(j)){count--;}                              
                                                                      }
                            ans=Math.min(ans,count);
                                        }        
		System.out.println(ans);
	}
}