import java.util.*;

public class Main {
    public static String mainString;
    public static String subString;
    public static int maxLength = 0;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        mainString = sc.nextLine();
        subString = sc.nextLine();

        for (int i = 0; i <= mainString.length() - subString.length(); i++) {
            loop(i);
        }

        System.out.println(subString.length() - maxLength);
    }

    public static void loop(int start) {
        String ms = mainString.substring(start, start + subString.length());
        check(ms);
    }

    public static void check(String ms) {
        int count = 0;
        for (int i = 0; i < subString.length(); i++) {
            if (ms.charAt(i) == subString.charAt(i)) {
                count++;
            }
        }
        if (maxLength < count) {
            maxLength = count;
        }
    }
} import java.util.*; util.* java public class Main {
    public static String mainString;
    public static String subString;
    public static int maxLength = 0;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        mainString = sc.nextLine();
        subString = sc.nextLine();

        for (int i = 0; i <= mainString.length() - subString.length(); i++) {
            loop(i);
        }

        System.out.println(subString.length() - maxLength);
    }

    public static void loop(int start) {
        String ms = mainString.substring(start, start + subString.length());
        check(ms);
    }

    public static void check(String ms) {
        int count = 0;
        for (int i = 0; i < subString.length(); i++) {
            if (ms.charAt(i) == subString.charAt(i)) {
                count++;
            }
        }
        if (maxLength < count) {
            maxLength = count;
        }
    }
} Main public static String mainString; mainString public static String subString; subString public static int maxLength = 0; maxLength 0 public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        mainString = sc.nextLine();
        subString = sc.nextLine();

        for (int i = 0; i <= mainString.length() - subString.length(); i++) {
            loop(i);
        }

        System.out.println(subString.length() - maxLength);
    } main {
        Scanner sc = new Scanner(System.in);
        mainString = sc.nextLine();
        subString = sc.nextLine();

        for (int i = 0; i <= mainString.length() - subString.length(); i++) {
            loop(i);
        }

        System.out.println(subString.length() - maxLength);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) mainString = sc.nextLine() mainString sc.nextLine() sc.nextLine sc subString = sc.nextLine() subString sc.nextLine() sc.nextLine sc for (int i = 0; i <= mainString.length() - subString.length(); i++) {
            loop(i);
        } int i = 0; int i = 0; i 0 i <= mainString.length() - subString.length() i mainString.length() - subString.length() mainString.length() mainString.length mainString subString.length() subString.length subString i++ i++ i {
            loop(i);
        } {
            loop(i);
        } loop(i) loop i System.out.println(subString.length() - maxLength) System.out.println System.out System System.out subString.length() - maxLength subString.length() subString.length subString maxLength String[] args args public static void loop(int start) {
        String ms = mainString.substring(start, start + subString.length());
        check(ms);
    } loop {
        String ms = mainString.substring(start, start + subString.length());
        check(ms);
    } String ms = mainString.substring(start, start + subString.length()); ms mainString.substring(start, start + subString.length()) mainString.substring mainString start start + subString.length() start subString.length() subString.length subString check(ms) check ms int start start public static void check(String ms) {
        int count = 0;
        for (int i = 0; i < subString.length(); i++) {
            if (ms.charAt(i) == subString.charAt(i)) {
                count++;
            }
        }
        if (maxLength < count) {
            maxLength = count;
        }
    } check {
        int count = 0;
        for (int i = 0; i < subString.length(); i++) {
            if (ms.charAt(i) == subString.charAt(i)) {
                count++;
            }
        }
        if (maxLength < count) {
            maxLength = count;
        }
    } int count = 0; count 0 for (int i = 0; i < subString.length(); i++) {
            if (ms.charAt(i) == subString.charAt(i)) {
                count++;
            }
        } int i = 0; int i = 0; i 0 i < subString.length() i subString.length() subString.length subString i++ i++ i {
            if (ms.charAt(i) == subString.charAt(i)) {
                count++;
            }
        } {
            if (ms.charAt(i) == subString.charAt(i)) {
                count++;
            }
        } if (ms.charAt(i) == subString.charAt(i)) {
                count++;
            } ms.charAt(i) == subString.charAt(i) ms.charAt(i) ms.charAt ms i subString.charAt(i) subString.charAt subString i {
                count++;
            } count++ count if (maxLength < count) {
            maxLength = count;
        } maxLength < count maxLength count {
            maxLength = count;
        } maxLength = count maxLength count String ms ms public class Main {
    public static String mainString;
    public static String subString;
    public static int maxLength = 0;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        mainString = sc.nextLine();
        subString = sc.nextLine();

        for (int i = 0; i <= mainString.length() - subString.length(); i++) {
            loop(i);
        }

        System.out.println(subString.length() - maxLength);
    }

    public static void loop(int start) {
        String ms = mainString.substring(start, start + subString.length());
        check(ms);
    }

    public static void check(String ms) {
        int count = 0;
        for (int i = 0; i < subString.length(); i++) {
            if (ms.charAt(i) == subString.charAt(i)) {
                count++;
            }
        }
        if (maxLength < count) {
            maxLength = count;
        }
    }
} public class Main {
    public static String mainString;
    public static String subString;
    public static int maxLength = 0;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        mainString = sc.nextLine();
        subString = sc.nextLine();

        for (int i = 0; i <= mainString.length() - subString.length(); i++) {
            loop(i);
        }

        System.out.println(subString.length() - maxLength);
    }

    public static void loop(int start) {
        String ms = mainString.substring(start, start + subString.length());
        check(ms);
    }

    public static void check(String ms) {
        int count = 0;
        for (int i = 0; i < subString.length(); i++) {
            if (ms.charAt(i) == subString.charAt(i)) {
                count++;
            }
        }
        if (maxLength < count) {
            maxLength = count;
        }
    }
} Main
import java.util.*;

public class Main {
    public static String mainString;
    public static String subString;
    public static int maxLength = 0;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        mainString = sc.nextLine();
        subString = sc.nextLine();

        for (int i = 0; i <= mainString.length() - subString.length(); i++) {
            loop(i);
        }

        System.out.println(subString.length() - maxLength);
    }

    public static void loop(int start) {
        String ms = mainString.substring(start, start + subString.length());
        check(ms);
    }

    public static void check(String ms) {
        int count = 0;
        for (int i = 0; i < subString.length(); i++) {
            if (ms.charAt(i) == subString.charAt(i)) {
                count++;
            }
        }
        if (maxLength < count) {
            maxLength = count;
        }
    }
}