import java.util.*;

public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        final String[] varS = sc.next().split("", 0);
        final String[] varT = sc.next().split("", 0);
        sc.close();
        int varSlen = varS.length;
        int varTlen = varT.length;
        int result = 0;
        int cnt = 0;
        //  変換文字列分比較をする
        for (int j = 0; j <= (varSlen - varTlen); j++) {
            cnt = 0;
            for (int i = 0; i < varTlen; i++) {
                if (varT[i].equals(varS[i + j])) {
                    cnt++;
                }
            }
            if (result < cnt) {
                result = cnt;
            }
        }
        result = varTlen - result;
        System.out.println(result);
    }
} import java.util.*; util.* java public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        final String[] varS = sc.next().split("", 0);
        final String[] varT = sc.next().split("", 0);
        sc.close();
        int varSlen = varS.length;
        int varTlen = varT.length;
        int result = 0;
        int cnt = 0;
        //  変換文字列分比較をする
        for (int j = 0; j <= (varSlen - varTlen); j++) {
            cnt = 0;
            for (int i = 0; i < varTlen; i++) {
                if (varT[i].equals(varS[i + j])) {
                    cnt++;
                }
            }
            if (result < cnt) {
                result = cnt;
            }
        }
        result = varTlen - result;
        System.out.println(result);
    }
} Main public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        final String[] varS = sc.next().split("", 0);
        final String[] varT = sc.next().split("", 0);
        sc.close();
        int varSlen = varS.length;
        int varTlen = varT.length;
        int result = 0;
        int cnt = 0;
        //  変換文字列分比較をする
        for (int j = 0; j <= (varSlen - varTlen); j++) {
            cnt = 0;
            for (int i = 0; i < varTlen; i++) {
                if (varT[i].equals(varS[i + j])) {
                    cnt++;
                }
            }
            if (result < cnt) {
                result = cnt;
            }
        }
        result = varTlen - result;
        System.out.println(result);
    } main {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        final String[] varS = sc.next().split("", 0);
        final String[] varT = sc.next().split("", 0);
        sc.close();
        int varSlen = varS.length;
        int varTlen = varT.length;
        int result = 0;
        int cnt = 0;
        //  変換文字列分比較をする
        for (int j = 0; j <= (varSlen - varTlen); j++) {
            cnt = 0;
            for (int i = 0; i < varTlen; i++) {
                if (varT[i].equals(varS[i + j])) {
                    cnt++;
                }
            }
            if (result < cnt) {
                result = cnt;
            }
        }
        result = varTlen - result;
        System.out.println(result);
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final String[] varS = sc.next().split("", 0); varS sc.next().split("", 0) sc.next().split sc.next() sc.next sc "" 0 final String[] varT = sc.next().split("", 0); varT sc.next().split("", 0) sc.next().split sc.next() sc.next sc "" 0 sc.close() sc.close sc int varSlen = varS.length; varSlen varS.length varS varS.length int varTlen = varT.length; varTlen varT.length varT varT.length int result = 0; result 0 int cnt = 0; cnt 0 for (int j = 0; j <= (varSlen - varTlen); j++) {
            cnt = 0;
            for (int i = 0; i < varTlen; i++) {
                if (varT[i].equals(varS[i + j])) {
                    cnt++;
                }
            }
            if (result < cnt) {
                result = cnt;
            }
        } int j = 0; int j = 0; j 0 j <= (varSlen - varTlen) j (varSlen - varTlen) varSlen varTlen j++ j++ j {
            cnt = 0;
            for (int i = 0; i < varTlen; i++) {
                if (varT[i].equals(varS[i + j])) {
                    cnt++;
                }
            }
            if (result < cnt) {
                result = cnt;
            }
        } {
            cnt = 0;
            for (int i = 0; i < varTlen; i++) {
                if (varT[i].equals(varS[i + j])) {
                    cnt++;
                }
            }
            if (result < cnt) {
                result = cnt;
            }
        } cnt = 0 cnt 0 for (int i = 0; i < varTlen; i++) {
                if (varT[i].equals(varS[i + j])) {
                    cnt++;
                }
            } int i = 0; int i = 0; i 0 i < varTlen i varTlen i++ i++ i {
                if (varT[i].equals(varS[i + j])) {
                    cnt++;
                }
            } {
                if (varT[i].equals(varS[i + j])) {
                    cnt++;
                }
            } if (varT[i].equals(varS[i + j])) {
                    cnt++;
                } varT[i].equals(varS[i + j]) varT[i].equals varT[i] varT i varS[i + j] varS i + j i j {
                    cnt++;
                } cnt++ cnt if (result < cnt) {
                result = cnt;
            } result < cnt result cnt {
                result = cnt;
            } result = cnt result cnt result = varTlen - result result varTlen - result varTlen result System.out.println(result) System.out.println System.out System System.out result final String[] args args public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        final String[] varS = sc.next().split("", 0);
        final String[] varT = sc.next().split("", 0);
        sc.close();
        int varSlen = varS.length;
        int varTlen = varT.length;
        int result = 0;
        int cnt = 0;
        //  変換文字列分比較をする
        for (int j = 0; j <= (varSlen - varTlen); j++) {
            cnt = 0;
            for (int i = 0; i < varTlen; i++) {
                if (varT[i].equals(varS[i + j])) {
                    cnt++;
                }
            }
            if (result < cnt) {
                result = cnt;
            }
        }
        result = varTlen - result;
        System.out.println(result);
    }
} public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        final String[] varS = sc.next().split("", 0);
        final String[] varT = sc.next().split("", 0);
        sc.close();
        int varSlen = varS.length;
        int varTlen = varT.length;
        int result = 0;
        int cnt = 0;
        //  変換文字列分比較をする
        for (int j = 0; j <= (varSlen - varTlen); j++) {
            cnt = 0;
            for (int i = 0; i < varTlen; i++) {
                if (varT[i].equals(varS[i + j])) {
                    cnt++;
                }
            }
            if (result < cnt) {
                result = cnt;
            }
        }
        result = varTlen - result;
        System.out.println(result);
    }
} Main
import java.util.*;

public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        final String[] varS = sc.next().split("", 0);
        final String[] varT = sc.next().split("", 0);
        sc.close();
        int varSlen = varS.length;
        int varTlen = varT.length;
        int result = 0;
        int cnt = 0;
        //  変換文字列分比較をする
        for (int j = 0; j <= (varSlen - varTlen); j++) {
            cnt = 0;
            for (int i = 0; i < varTlen; i++) {
                if (varT[i].equals(varS[i + j])) {
                    cnt++;
                }
            }
            if (result < cnt) {
                result = cnt;
            }
        }
        result = varTlen - result;
        System.out.println(result);
    }
}