import java.util.Scanner;

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

            int min = (int) 1e9;
            for (int start = 0; start + T.length() <= S.length(); start++) {
                int count = 0;
                for (int i = 0; i < T.length(); i++) {
                    if (T.charAt(i) != S.charAt(start + i)) {
                        count++;
                    }
                }
                min = Math.min(min, count);
            }
            System.out.println(min);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            String S = sc.next();
            String T = sc.next();

            int min = (int) 1e9;
            for (int start = 0; start + T.length() <= S.length(); start++) {
                int count = 0;
                for (int i = 0; i < T.length(); i++) {
                    if (T.charAt(i) != S.charAt(start + i)) {
                        count++;
                    }
                }
                min = Math.min(min, count);
            }
            System.out.println(min);
        }
    }
} Main public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            String S = sc.next();
            String T = sc.next();

            int min = (int) 1e9;
            for (int start = 0; start + T.length() <= S.length(); start++) {
                int count = 0;
                for (int i = 0; i < T.length(); i++) {
                    if (T.charAt(i) != S.charAt(start + i)) {
                        count++;
                    }
                }
                min = Math.min(min, count);
            }
            System.out.println(min);
        }
    } main {
        try (Scanner sc = new Scanner(System.in)) {
            String S = sc.next();
            String T = sc.next();

            int min = (int) 1e9;
            for (int start = 0; start + T.length() <= S.length(); start++) {
                int count = 0;
                for (int i = 0; i < T.length(); i++) {
                    if (T.charAt(i) != S.charAt(start + i)) {
                        count++;
                    }
                }
                min = Math.min(min, count);
            }
            System.out.println(min);
        }
    } try (Scanner sc = new Scanner(System.in)) {
            String S = sc.next();
            String T = sc.next();

            int min = (int) 1e9;
            for (int start = 0; start + T.length() <= S.length(); start++) {
                int count = 0;
                for (int i = 0; i < T.length(); i++) {
                    if (T.charAt(i) != S.charAt(start + i)) {
                        count++;
                    }
                }
                min = Math.min(min, count);
            }
            System.out.println(min);
        } {
            String S = sc.next();
            String T = sc.next();

            int min = (int) 1e9;
            for (int start = 0; start + T.length() <= S.length(); start++) {
                int count = 0;
                for (int i = 0; i < T.length(); i++) {
                    if (T.charAt(i) != S.charAt(start + i)) {
                        count++;
                    }
                }
                min = Math.min(min, count);
            }
            System.out.println(min);
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) 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 min = (int) 1e9; min (int) 1e9 for (int start = 0; start + T.length() <= S.length(); start++) {
                int count = 0;
                for (int i = 0; i < T.length(); i++) {
                    if (T.charAt(i) != S.charAt(start + i)) {
                        count++;
                    }
                }
                min = Math.min(min, count);
            } int start = 0; int start = 0; start 0 start + T.length() <= S.length() start + T.length() start T.length() T.length T S.length() S.length S start++ start++ start {
                int count = 0;
                for (int i = 0; i < T.length(); i++) {
                    if (T.charAt(i) != S.charAt(start + i)) {
                        count++;
                    }
                }
                min = Math.min(min, count);
            } {
                int count = 0;
                for (int i = 0; i < T.length(); i++) {
                    if (T.charAt(i) != S.charAt(start + i)) {
                        count++;
                    }
                }
                min = Math.min(min, count);
            } int count = 0; count 0 for (int i = 0; i < T.length(); i++) {
                    if (T.charAt(i) != S.charAt(start + i)) {
                        count++;
                    }
                } int i = 0; int i = 0; i 0 i < T.length() i T.length() T.length T i++ i++ i {
                    if (T.charAt(i) != S.charAt(start + i)) {
                        count++;
                    }
                } {
                    if (T.charAt(i) != S.charAt(start + i)) {
                        count++;
                    }
                } if (T.charAt(i) != S.charAt(start + i)) {
                        count++;
                    } T.charAt(i) != S.charAt(start + i) T.charAt(i) T.charAt T i S.charAt(start + i) S.charAt S start + i start i {
                        count++;
                    } count++ count min = Math.min(min, count) min Math.min(min, count) Math.min Math min count 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) {
        try (Scanner sc = new Scanner(System.in)) {
            String S = sc.next();
            String T = sc.next();

            int min = (int) 1e9;
            for (int start = 0; start + T.length() <= S.length(); start++) {
                int count = 0;
                for (int i = 0; i < T.length(); i++) {
                    if (T.charAt(i) != S.charAt(start + i)) {
                        count++;
                    }
                }
                min = Math.min(min, count);
            }
            System.out.println(min);
        }
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            String S = sc.next();
            String T = sc.next();

            int min = (int) 1e9;
            for (int start = 0; start + T.length() <= S.length(); start++) {
                int count = 0;
                for (int i = 0; i < T.length(); i++) {
                    if (T.charAt(i) != S.charAt(start + i)) {
                        count++;
                    }
                }
                min = Math.min(min, count);
            }
            System.out.println(min);
        }
    }
} Main
import java.util.Scanner;

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

            int min = (int) 1e9;
            for (int start = 0; start + T.length() <= S.length(); start++) {
                int count = 0;
                for (int i = 0; i < T.length(); i++) {
                    if (T.charAt(i) != S.charAt(start + i)) {
                        count++;
                    }
                }
                min = Math.min(min, count);
            }
            System.out.println(min);
        }
    }
}
