import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        String S = sc.nextLine();
        String T = sc.nextLine();

        int Sl = S.length();
        int Tl = T.length();
        int min = 1000;

        for(int i = 0; i < (Sl-Tl+1); i++) {
            char[] Schr = S.toCharArray();
            char[] Tchr = T.toCharArray();
            int tmp = 0;
            for (int j = 0; j < Tl; j++) {
                if (Schr[j + i] == Tchr[j]) {
                    tmp++;
                }
            }
            tmp = Tl - tmp;
            if(tmp < min){
                min = tmp;
            } else if(tmp == 0) {
                break;
            }
        }
        System.out.println(min);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        String S = sc.nextLine();
        String T = sc.nextLine();

        int Sl = S.length();
        int Tl = T.length();
        int min = 1000;

        for(int i = 0; i < (Sl-Tl+1); i++) {
            char[] Schr = S.toCharArray();
            char[] Tchr = T.toCharArray();
            int tmp = 0;
            for (int j = 0; j < Tl; j++) {
                if (Schr[j + i] == Tchr[j]) {
                    tmp++;
                }
            }
            tmp = Tl - tmp;
            if(tmp < min){
                min = tmp;
            } else if(tmp == 0) {
                break;
            }
        }
        System.out.println(min);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        String S = sc.nextLine();
        String T = sc.nextLine();

        int Sl = S.length();
        int Tl = T.length();
        int min = 1000;

        for(int i = 0; i < (Sl-Tl+1); i++) {
            char[] Schr = S.toCharArray();
            char[] Tchr = T.toCharArray();
            int tmp = 0;
            for (int j = 0; j < Tl; j++) {
                if (Schr[j + i] == Tchr[j]) {
                    tmp++;
                }
            }
            tmp = Tl - tmp;
            if(tmp < min){
                min = tmp;
            } else if(tmp == 0) {
                break;
            }
        }
        System.out.println(min);
    } main {
        Scanner sc = new Scanner(System.in);
        
        String S = sc.nextLine();
        String T = sc.nextLine();

        int Sl = S.length();
        int Tl = T.length();
        int min = 1000;

        for(int i = 0; i < (Sl-Tl+1); i++) {
            char[] Schr = S.toCharArray();
            char[] Tchr = T.toCharArray();
            int tmp = 0;
            for (int j = 0; j < Tl; j++) {
                if (Schr[j + i] == Tchr[j]) {
                    tmp++;
                }
            }
            tmp = Tl - tmp;
            if(tmp < min){
                min = tmp;
            } else if(tmp == 0) {
                break;
            }
        }
        System.out.println(min);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc String T = sc.nextLine(); T sc.nextLine() sc.nextLine sc int Sl = S.length(); Sl S.length() S.length S int Tl = T.length(); Tl T.length() T.length T int min = 1000; min 1000 for(int i = 0; i < (Sl-Tl+1); i++) {
            char[] Schr = S.toCharArray();
            char[] Tchr = T.toCharArray();
            int tmp = 0;
            for (int j = 0; j < Tl; j++) {
                if (Schr[j + i] == Tchr[j]) {
                    tmp++;
                }
            }
            tmp = Tl - tmp;
            if(tmp < min){
                min = tmp;
            } else if(tmp == 0) {
                break;
            }
        } int i = 0; int i = 0; i 0 i < (Sl-Tl+1) i (Sl-Tl+1) Sl-Tl Sl Tl 1 i++ i++ i {
            char[] Schr = S.toCharArray();
            char[] Tchr = T.toCharArray();
            int tmp = 0;
            for (int j = 0; j < Tl; j++) {
                if (Schr[j + i] == Tchr[j]) {
                    tmp++;
                }
            }
            tmp = Tl - tmp;
            if(tmp < min){
                min = tmp;
            } else if(tmp == 0) {
                break;
            }
        } {
            char[] Schr = S.toCharArray();
            char[] Tchr = T.toCharArray();
            int tmp = 0;
            for (int j = 0; j < Tl; j++) {
                if (Schr[j + i] == Tchr[j]) {
                    tmp++;
                }
            }
            tmp = Tl - tmp;
            if(tmp < min){
                min = tmp;
            } else if(tmp == 0) {
                break;
            }
        } char[] Schr = S.toCharArray(); Schr S.toCharArray() S.toCharArray S char[] Tchr = T.toCharArray(); Tchr T.toCharArray() T.toCharArray T int tmp = 0; tmp 0 for (int j = 0; j < Tl; j++) {
                if (Schr[j + i] == Tchr[j]) {
                    tmp++;
                }
            } int j = 0; int j = 0; j 0 j < Tl j Tl j++ j++ j {
                if (Schr[j + i] == Tchr[j]) {
                    tmp++;
                }
            } {
                if (Schr[j + i] == Tchr[j]) {
                    tmp++;
                }
            } if (Schr[j + i] == Tchr[j]) {
                    tmp++;
                } Schr[j + i] == Tchr[j] Schr[j + i] Schr j + i j i Tchr[j] Tchr j {
                    tmp++;
                } tmp++ tmp tmp = Tl - tmp tmp Tl - tmp Tl tmp if(tmp < min){
                min = tmp;
            } else if(tmp == 0) {
                break;
            } tmp < min tmp min {
                min = tmp;
            } min = tmp min tmp if(tmp == 0) {
                break;
            } tmp == 0 tmp 0 {
                break;
            } break; System.out.println(min) System.out.println System.out System System.out min String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        String S = sc.nextLine();
        String T = sc.nextLine();

        int Sl = S.length();
        int Tl = T.length();
        int min = 1000;

        for(int i = 0; i < (Sl-Tl+1); i++) {
            char[] Schr = S.toCharArray();
            char[] Tchr = T.toCharArray();
            int tmp = 0;
            for (int j = 0; j < Tl; j++) {
                if (Schr[j + i] == Tchr[j]) {
                    tmp++;
                }
            }
            tmp = Tl - tmp;
            if(tmp < min){
                min = tmp;
            } else if(tmp == 0) {
                break;
            }
        }
        System.out.println(min);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        String S = sc.nextLine();
        String T = sc.nextLine();

        int Sl = S.length();
        int Tl = T.length();
        int min = 1000;

        for(int i = 0; i < (Sl-Tl+1); i++) {
            char[] Schr = S.toCharArray();
            char[] Tchr = T.toCharArray();
            int tmp = 0;
            for (int j = 0; j < Tl; j++) {
                if (Schr[j + i] == Tchr[j]) {
                    tmp++;
                }
            }
            tmp = Tl - tmp;
            if(tmp < min){
                min = tmp;
            } else if(tmp == 0) {
                break;
            }
        }
        System.out.println(min);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        
        String S = sc.nextLine();
        String T = sc.nextLine();

        int Sl = S.length();
        int Tl = T.length();
        int min = 1000;

        for(int i = 0; i < (Sl-Tl+1); i++) {
            char[] Schr = S.toCharArray();
            char[] Tchr = T.toCharArray();
            int tmp = 0;
            for (int j = 0; j < Tl; j++) {
                if (Schr[j + i] == Tchr[j]) {
                    tmp++;
                }
            }
            tmp = Tl - tmp;
            if(tmp < min){
                min = tmp;
            } else if(tmp == 0) {
                break;
            }
        }
        System.out.println(min);
    }
}