import 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 cnt = 0, min = T.length();
            for (int i = 0; i <= S.length() - T.length(); i++) {
                cnt = 0;
                for (int j = 0; j < T.length(); j++) {
                    if (S.charAt(i + j) != T.charAt(j)) {
                        cnt++;
                    }
                }
                min = Math.min(cnt, min);
            }
            System.out.println(min);
        }
    }
} import java.util.*; util.* java 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 cnt = 0, min = T.length();
            for (int i = 0; i <= S.length() - T.length(); i++) {
                cnt = 0;
                for (int j = 0; j < T.length(); j++) {
                    if (S.charAt(i + j) != T.charAt(j)) {
                        cnt++;
                    }
                }
                min = Math.min(cnt, min);
            }
            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 cnt = 0, min = T.length();
            for (int i = 0; i <= S.length() - T.length(); i++) {
                cnt = 0;
                for (int j = 0; j < T.length(); j++) {
                    if (S.charAt(i + j) != T.charAt(j)) {
                        cnt++;
                    }
                }
                min = Math.min(cnt, min);
            }
            System.out.println(min);
        }
    } main {
        try (Scanner sc = new Scanner(System.in)) {
            String S = sc.next();
            String T = sc.next();

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

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

            int cnt = 0, min = T.length();
            for (int i = 0; i <= S.length() - T.length(); i++) {
                cnt = 0;
                for (int j = 0; j < T.length(); j++) {
                    if (S.charAt(i + j) != T.charAt(j)) {
                        cnt++;
                    }
                }
                min = Math.min(cnt, min);
            }
            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 cnt = 0 cnt 0 min = T.length(); min T.length() T.length T for (int i = 0; i <= S.length() - T.length(); i++) {
                cnt = 0;
                for (int j = 0; j < T.length(); j++) {
                    if (S.charAt(i + j) != T.charAt(j)) {
                        cnt++;
                    }
                }
                min = Math.min(cnt, min);
            } int i = 0; int i = 0; i 0 i <= S.length() - T.length() i S.length() - T.length() S.length() S.length S T.length() T.length T i++ i++ i {
                cnt = 0;
                for (int j = 0; j < T.length(); j++) {
                    if (S.charAt(i + j) != T.charAt(j)) {
                        cnt++;
                    }
                }
                min = Math.min(cnt, min);
            } {
                cnt = 0;
                for (int j = 0; j < T.length(); j++) {
                    if (S.charAt(i + j) != T.charAt(j)) {
                        cnt++;
                    }
                }
                min = Math.min(cnt, min);
            } cnt = 0 cnt 0 for (int j = 0; j < T.length(); j++) {
                    if (S.charAt(i + j) != T.charAt(j)) {
                        cnt++;
                    }
                } int j = 0; int j = 0; j 0 j < T.length() j T.length() T.length T j++ j++ j {
                    if (S.charAt(i + j) != T.charAt(j)) {
                        cnt++;
                    }
                } {
                    if (S.charAt(i + j) != T.charAt(j)) {
                        cnt++;
                    }
                } if (S.charAt(i + j) != T.charAt(j)) {
                        cnt++;
                    } S.charAt(i + j) != T.charAt(j) S.charAt(i + j) S.charAt S i + j i j T.charAt(j) T.charAt T j {
                        cnt++;
                    } cnt++ cnt min = Math.min(cnt, min) min Math.min(cnt, min) Math.min Math cnt min 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 cnt = 0, min = T.length();
            for (int i = 0; i <= S.length() - T.length(); i++) {
                cnt = 0;
                for (int j = 0; j < T.length(); j++) {
                    if (S.charAt(i + j) != T.charAt(j)) {
                        cnt++;
                    }
                }
                min = Math.min(cnt, min);
            }
            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 cnt = 0, min = T.length();
            for (int i = 0; i <= S.length() - T.length(); i++) {
                cnt = 0;
                for (int j = 0; j < T.length(); j++) {
                    if (S.charAt(i + j) != T.charAt(j)) {
                        cnt++;
                    }
                }
                min = Math.min(cnt, min);
            }
            System.out.println(min);
        }
    }
} Main
import 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 cnt = 0, min = T.length();
            for (int i = 0; i <= S.length() - T.length(); i++) {
                cnt = 0;
                for (int j = 0; j < T.length(); j++) {
                    if (S.charAt(i + j) != T.charAt(j)) {
                        cnt++;
                    }
                }
                min = Math.min(cnt, min);
            }
            System.out.println(min);
        }
    }
}
