import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
    
        System.out.println(dirrerentString(S,T));
    }
    
    private static int dirrerentString(String p, String c) {
        int different = 1001;
        for (int i=0; i<=p.length()-c.length(); i++) {
            int d = dirrerentLetter(c, p.substring(i, i+c.length()));
            if (d < different) {
                different = d;
                if (different == 0) {
                    break;
                }
            }
        }
        return different;
    }
    
    private static int dirrerentLetter(String s1, String s2) {
        int result = 0;
        for (int i=0; i<s1.length(); i++) {
            if (s1.charAt(i) != s2.charAt(i)) {
                result++;
            }
        }
        return result;
    }
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
    
        System.out.println(dirrerentString(S,T));
    }
    
    private static int dirrerentString(String p, String c) {
        int different = 1001;
        for (int i=0; i<=p.length()-c.length(); i++) {
            int d = dirrerentLetter(c, p.substring(i, i+c.length()));
            if (d < different) {
                different = d;
                if (different == 0) {
                    break;
                }
            }
        }
        return different;
    }
    
    private static int dirrerentLetter(String s1, String s2) {
        int result = 0;
        for (int i=0; i<s1.length(); i++) {
            if (s1.charAt(i) != s2.charAt(i)) {
                result++;
            }
        }
        return result;
    }
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
    
        System.out.println(dirrerentString(S,T));
    } main {
		Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
    
        System.out.println(dirrerentString(S,T));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc String T = sc.next(); T sc.next() sc.next sc System.out.println(dirrerentString(S,T)) System.out.println System.out System System.out dirrerentString(S,T) dirrerentString S T String[] args args private static int dirrerentString(String p, String c) {
        int different = 1001;
        for (int i=0; i<=p.length()-c.length(); i++) {
            int d = dirrerentLetter(c, p.substring(i, i+c.length()));
            if (d < different) {
                different = d;
                if (different == 0) {
                    break;
                }
            }
        }
        return different;
    } dirrerentString {
        int different = 1001;
        for (int i=0; i<=p.length()-c.length(); i++) {
            int d = dirrerentLetter(c, p.substring(i, i+c.length()));
            if (d < different) {
                different = d;
                if (different == 0) {
                    break;
                }
            }
        }
        return different;
    } int different = 1001; different 1001 for (int i=0; i<=p.length()-c.length(); i++) {
            int d = dirrerentLetter(c, p.substring(i, i+c.length()));
            if (d < different) {
                different = d;
                if (different == 0) {
                    break;
                }
            }
        } int i=0; int i=0; i 0 i<=p.length()-c.length() i p.length()-c.length() p.length() p.length p c.length() c.length c i++ i++ i {
            int d = dirrerentLetter(c, p.substring(i, i+c.length()));
            if (d < different) {
                different = d;
                if (different == 0) {
                    break;
                }
            }
        } {
            int d = dirrerentLetter(c, p.substring(i, i+c.length()));
            if (d < different) {
                different = d;
                if (different == 0) {
                    break;
                }
            }
        } int d = dirrerentLetter(c, p.substring(i, i+c.length())); d dirrerentLetter(c, p.substring(i, i+c.length())) dirrerentLetter c p.substring(i, i+c.length()) p.substring p i i+c.length() i c.length() c.length c if (d < different) {
                different = d;
                if (different == 0) {
                    break;
                }
            } d < different d different {
                different = d;
                if (different == 0) {
                    break;
                }
            } different = d different d if (different == 0) {
                    break;
                } different == 0 different 0 {
                    break;
                } break; return different; different String p p String c c private static int dirrerentLetter(String s1, String s2) {
        int result = 0;
        for (int i=0; i<s1.length(); i++) {
            if (s1.charAt(i) != s2.charAt(i)) {
                result++;
            }
        }
        return result;
    } dirrerentLetter {
        int result = 0;
        for (int i=0; i<s1.length(); i++) {
            if (s1.charAt(i) != s2.charAt(i)) {
                result++;
            }
        }
        return result;
    } int result = 0; result 0 for (int i=0; i<s1.length(); i++) {
            if (s1.charAt(i) != s2.charAt(i)) {
                result++;
            }
        } int i=0; int i=0; i 0 i<s1.length() i s1.length() s1.length s1 i++ i++ i {
            if (s1.charAt(i) != s2.charAt(i)) {
                result++;
            }
        } {
            if (s1.charAt(i) != s2.charAt(i)) {
                result++;
            }
        } if (s1.charAt(i) != s2.charAt(i)) {
                result++;
            } s1.charAt(i) != s2.charAt(i) s1.charAt(i) s1.charAt s1 i s2.charAt(i) s2.charAt s2 i {
                result++;
            } result++ result return result; result String s1 s1 String s2 s2 public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
    
        System.out.println(dirrerentString(S,T));
    }
    
    private static int dirrerentString(String p, String c) {
        int different = 1001;
        for (int i=0; i<=p.length()-c.length(); i++) {
            int d = dirrerentLetter(c, p.substring(i, i+c.length()));
            if (d < different) {
                different = d;
                if (different == 0) {
                    break;
                }
            }
        }
        return different;
    }
    
    private static int dirrerentLetter(String s1, String s2) {
        int result = 0;
        for (int i=0; i<s1.length(); i++) {
            if (s1.charAt(i) != s2.charAt(i)) {
                result++;
            }
        }
        return result;
    }
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
    
        System.out.println(dirrerentString(S,T));
    }
    
    private static int dirrerentString(String p, String c) {
        int different = 1001;
        for (int i=0; i<=p.length()-c.length(); i++) {
            int d = dirrerentLetter(c, p.substring(i, i+c.length()));
            if (d < different) {
                different = d;
                if (different == 0) {
                    break;
                }
            }
        }
        return different;
    }
    
    private static int dirrerentLetter(String s1, String s2) {
        int result = 0;
        for (int i=0; i<s1.length(); i++) {
            if (s1.charAt(i) != s2.charAt(i)) {
                result++;
            }
        }
        return result;
    }
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        String S = sc.next();
        String T = sc.next();
    
        System.out.println(dirrerentString(S,T));
    }
    
    private static int dirrerentString(String p, String c) {
        int different = 1001;
        for (int i=0; i<=p.length()-c.length(); i++) {
            int d = dirrerentLetter(c, p.substring(i, i+c.length()));
            if (d < different) {
                different = d;
                if (different == 0) {
                    break;
                }
            }
        }
        return different;
    }
    
    private static int dirrerentLetter(String s1, String s2) {
        int result = 0;
        for (int i=0; i<s1.length(); i++) {
            if (s1.charAt(i) != s2.charAt(i)) {
                result++;
            }
        }
        return result;
    }
}
