import java.util.Scanner;

/**
 *
 * @author joeco
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Scanner in = new Scanner(System.in);
        String s  = in.next();
        String t  = in.next();
        
        
        int res = t.length()-overlaps(s, t);
        System.out.println(res);
        
    }
    
    public static int overlaps(String s, String t) {
        int res = 0;
        for(int i = 0; i < t.length(); i++) {
            if(t.charAt(i)==(s.charAt(i))) res++;
        }
        
        int res2 = 0;
        if(t.length() <= s.length()-1) res2=overlaps(s.substring(1), t);
        
        return Math.max(res, res2);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Scanner in = new Scanner(System.in);
        String s  = in.next();
        String t  = in.next();
        
        
        int res = t.length()-overlaps(s, t);
        System.out.println(res);
        
    }
    
    public static int overlaps(String s, String t) {
        int res = 0;
        for(int i = 0; i < t.length(); i++) {
            if(t.charAt(i)==(s.charAt(i))) res++;
        }
        
        int res2 = 0;
        if(t.length() <= s.length()-1) res2=overlaps(s.substring(1), t);
        
        return Math.max(res, res2);
    }
} Main /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Scanner in = new Scanner(System.in);
        String s  = in.next();
        String t  = in.next();
        
        
        int res = t.length()-overlaps(s, t);
        System.out.println(res);
        
    } main {
        
        Scanner in = new Scanner(System.in);
        String s  = in.next();
        String t  = in.next();
        
        
        int res = t.length()-overlaps(s, t);
        System.out.println(res);
        
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) String s  = in.next(); s in.next() in.next in String t  = in.next(); t in.next() in.next in int res = t.length()-overlaps(s, t); res t.length()-overlaps(s, t) t.length() t.length t overlaps(s, t) overlaps s t System.out.println(res) System.out.println System.out System System.out res String[] args args public static int overlaps(String s, String t) {
        int res = 0;
        for(int i = 0; i < t.length(); i++) {
            if(t.charAt(i)==(s.charAt(i))) res++;
        }
        
        int res2 = 0;
        if(t.length() <= s.length()-1) res2=overlaps(s.substring(1), t);
        
        return Math.max(res, res2);
    } overlaps {
        int res = 0;
        for(int i = 0; i < t.length(); i++) {
            if(t.charAt(i)==(s.charAt(i))) res++;
        }
        
        int res2 = 0;
        if(t.length() <= s.length()-1) res2=overlaps(s.substring(1), t);
        
        return Math.max(res, res2);
    } int res = 0; res 0 for(int i = 0; i < t.length(); i++) {
            if(t.charAt(i)==(s.charAt(i))) res++;
        } int i = 0; int i = 0; i 0 i < t.length() i t.length() t.length t i++ i++ i {
            if(t.charAt(i)==(s.charAt(i))) res++;
        } {
            if(t.charAt(i)==(s.charAt(i))) res++;
        } if(t.charAt(i)==(s.charAt(i))) res++; t.charAt(i)==(s.charAt(i)) t.charAt(i) t.charAt t i (s.charAt(i)) s.charAt s i res++ res int res2 = 0; res2 0 if(t.length() <= s.length()-1) res2=overlaps(s.substring(1), t); t.length() <= s.length()-1 t.length() t.length t s.length()-1 s.length() s.length s 1 res2=overlaps(s.substring(1), t) res2 overlaps(s.substring(1), t) overlaps s.substring(1) s.substring s 1 t return Math.max(res, res2); Math.max(res, res2) Math.max Math res res2 String s s String t t public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Scanner in = new Scanner(System.in);
        String s  = in.next();
        String t  = in.next();
        
        
        int res = t.length()-overlaps(s, t);
        System.out.println(res);
        
    }
    
    public static int overlaps(String s, String t) {
        int res = 0;
        for(int i = 0; i < t.length(); i++) {
            if(t.charAt(i)==(s.charAt(i))) res++;
        }
        
        int res2 = 0;
        if(t.length() <= s.length()-1) res2=overlaps(s.substring(1), t);
        
        return Math.max(res, res2);
    }
} public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Scanner in = new Scanner(System.in);
        String s  = in.next();
        String t  = in.next();
        
        
        int res = t.length()-overlaps(s, t);
        System.out.println(res);
        
    }
    
    public static int overlaps(String s, String t) {
        int res = 0;
        for(int i = 0; i < t.length(); i++) {
            if(t.charAt(i)==(s.charAt(i))) res++;
        }
        
        int res2 = 0;
        if(t.length() <= s.length()-1) res2=overlaps(s.substring(1), t);
        
        return Math.max(res, res2);
    }
} Main
import java.util.Scanner;

/**
 *
 * @author joeco
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Scanner in = new Scanner(System.in);
        String s  = in.next();
        String t  = in.next();
        
        
        int res = t.length()-overlaps(s, t);
        System.out.println(res);
        
    }
    
    public static int overlaps(String s, String t) {
        int res = 0;
        for(int i = 0; i < t.length(); i++) {
            if(t.charAt(i)==(s.charAt(i))) res++;
        }
        
        int res2 = 0;
        if(t.length() <= s.length()-1) res2=overlaps(s.substring(1), t);
        
        return Math.max(res, res2);
    }
}