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 changeCount =  T.length();
        //比較する最初の文字を決める
        for(int start=0; start<=S.length()-T.length(); start++) {
            int count = 0;
            for(int i=0; i<T.length(); i++) {
                if(S.charAt(start+i)!=(T.charAt(i)))  {
                    count ++;
                }
            }
            if(changeCount > count) {
                changeCount = count;
            }
        }
        System.out.println(changeCount);
    }
} 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 changeCount =  T.length();
        //比較する最初の文字を決める
        for(int start=0; start<=S.length()-T.length(); start++) {
            int count = 0;
            for(int i=0; i<T.length(); i++) {
                if(S.charAt(start+i)!=(T.charAt(i)))  {
                    count ++;
                }
            }
            if(changeCount > count) {
                changeCount = count;
            }
        }
        System.out.println(changeCount);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
        int changeCount =  T.length();
        //比較する最初の文字を決める
        for(int start=0; start<=S.length()-T.length(); start++) {
            int count = 0;
            for(int i=0; i<T.length(); i++) {
                if(S.charAt(start+i)!=(T.charAt(i)))  {
                    count ++;
                }
            }
            if(changeCount > count) {
                changeCount = count;
            }
        }
        System.out.println(changeCount);
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
        int changeCount =  T.length();
        //比較する最初の文字を決める
        for(int start=0; start<=S.length()-T.length(); start++) {
            int count = 0;
            for(int i=0; i<T.length(); i++) {
                if(S.charAt(start+i)!=(T.charAt(i)))  {
                    count ++;
                }
            }
            if(changeCount > count) {
                changeCount = count;
            }
        }
        System.out.println(changeCount);
    } 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 changeCount =  T.length(); changeCount T.length() T.length T for(int start=0; start<=S.length()-T.length(); start++) {
            int count = 0;
            for(int i=0; i<T.length(); i++) {
                if(S.charAt(start+i)!=(T.charAt(i)))  {
                    count ++;
                }
            }
            if(changeCount > count) {
                changeCount = count;
            }
        } int start=0; int start=0; start 0 start<=S.length()-T.length() start S.length()-T.length() S.length() S.length S T.length() T.length T start++ start++ start {
            int count = 0;
            for(int i=0; i<T.length(); i++) {
                if(S.charAt(start+i)!=(T.charAt(i)))  {
                    count ++;
                }
            }
            if(changeCount > count) {
                changeCount = count;
            }
        } {
            int count = 0;
            for(int i=0; i<T.length(); i++) {
                if(S.charAt(start+i)!=(T.charAt(i)))  {
                    count ++;
                }
            }
            if(changeCount > count) {
                changeCount = count;
            }
        } int count = 0; count 0 for(int i=0; i<T.length(); i++) {
                if(S.charAt(start+i)!=(T.charAt(i)))  {
                    count ++;
                }
            } int i=0; int i=0; i 0 i<T.length() i T.length() T.length T i++ i++ i {
                if(S.charAt(start+i)!=(T.charAt(i)))  {
                    count ++;
                }
            } {
                if(S.charAt(start+i)!=(T.charAt(i)))  {
                    count ++;
                }
            } if(S.charAt(start+i)!=(T.charAt(i)))  {
                    count ++;
                } S.charAt(start+i)!=(T.charAt(i)) S.charAt(start+i) S.charAt S start+i start i (T.charAt(i)) T.charAt T i {
                    count ++;
                } count ++ count if(changeCount > count) {
                changeCount = count;
            } changeCount > count changeCount count {
                changeCount = count;
            } changeCount = count changeCount count System.out.println(changeCount) System.out.println System.out System System.out changeCount 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 changeCount =  T.length();
        //比較する最初の文字を決める
        for(int start=0; start<=S.length()-T.length(); start++) {
            int count = 0;
            for(int i=0; i<T.length(); i++) {
                if(S.charAt(start+i)!=(T.charAt(i)))  {
                    count ++;
                }
            }
            if(changeCount > count) {
                changeCount = count;
            }
        }
        System.out.println(changeCount);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
        int changeCount =  T.length();
        //比較する最初の文字を決める
        for(int start=0; start<=S.length()-T.length(); start++) {
            int count = 0;
            for(int i=0; i<T.length(); i++) {
                if(S.charAt(start+i)!=(T.charAt(i)))  {
                    count ++;
                }
            }
            if(changeCount > count) {
                changeCount = count;
            }
        }
        System.out.println(changeCount);
    }
} 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 changeCount =  T.length();
        //比較する最初の文字を決める
        for(int start=0; start<=S.length()-T.length(); start++) {
            int count = 0;
            for(int i=0; i<T.length(); i++) {
                if(S.charAt(start+i)!=(T.charAt(i)))  {
                    count ++;
                }
            }
            if(changeCount > count) {
                changeCount = count;
            }
        }
        System.out.println(changeCount);
    }
}
