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();
        String[] s = S.split("");
        String[] t = T.split("");
        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[i+j].equals(t[j])) {
                    count--;
                }
            }
            if(ans > count) 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();
        String[] s = S.split("");
        String[] t = T.split("");
        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[i+j].equals(t[j])) {
                    count--;
                }
            }
            if(ans > count) 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();
        String[] s = S.split("");
        String[] t = T.split("");
        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[i+j].equals(t[j])) {
                    count--;
                }
            }
            if(ans > count) ans = count;
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
        String[] s = S.split("");
        String[] t = T.split("");
        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[i+j].equals(t[j])) {
                    count--;
                }
            }
            if(ans > count) 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 String[] s = S.split(""); s S.split("") S.split S "" String[] t = T.split(""); t T.split("") T.split T "" int ans = t.length; ans t.length t 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[i+j].equals(t[j])) {
                    count--;
                }
            }
            if(ans > count) ans = count;
        } int i=0; int i=0; i 0 i<=s.length-t.length i s.length-t.length s.length s s.length t.length t t.length i++ i++ i {
            int count = t.length;
            for(int j=0; j<t.length; j++) {
                if(s[i+j].equals(t[j])) {
                    count--;
                }
            }
            if(ans > count) ans = count;
        } {
            int count = t.length;
            for(int j=0; j<t.length; j++) {
                if(s[i+j].equals(t[j])) {
                    count--;
                }
            }
            if(ans > count) ans = count;
        } int count = t.length; count t.length t t.length for(int j=0; j<t.length; j++) {
                if(s[i+j].equals(t[j])) {
                    count--;
                }
            } int j=0; int j=0; j 0 j<t.length j t.length t t.length j++ j++ j {
                if(s[i+j].equals(t[j])) {
                    count--;
                }
            } {
                if(s[i+j].equals(t[j])) {
                    count--;
                }
            } if(s[i+j].equals(t[j])) {
                    count--;
                } s[i+j].equals(t[j]) s[i+j].equals s[i+j] s i+j i j t[j] t j {
                    count--;
                } count-- count if(ans > count) ans = count; ans > count ans count ans = count 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();
        String[] s = S.split("");
        String[] t = T.split("");
        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[i+j].equals(t[j])) {
                    count--;
                }
            }
            if(ans > count) 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();
        String[] s = S.split("");
        String[] t = T.split("");
        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[i+j].equals(t[j])) {
                    count--;
                }
            }
            if(ans > count) 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();
        String[] s = S.split("");
        String[] t = T.split("");
        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[i+j].equals(t[j])) {
                    count--;
                }
            }
            if(ans > count) ans = count;
        }
        System.out.println(ans);
    }
}
