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();
	int min = Integer.MAX_VALUE;
	int count = 0;
	for (int i=0; i<=s.length()-t.length(); i++) {
	    String sis = s.substring(i,i+t.length());
	    count = 0;
	    for (int j=0; j<t.length(); j++) {
		if (sis.charAt(j) != t.charAt(j)) {
		    count++;
		}
	    }
	    if (count < min) {
		min = count;
	    }
	}
	System.out.print(min);
    }
} 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();
	int min = Integer.MAX_VALUE;
	int count = 0;
	for (int i=0; i<=s.length()-t.length(); i++) {
	    String sis = s.substring(i,i+t.length());
	    count = 0;
	    for (int j=0; j<t.length(); j++) {
		if (sis.charAt(j) != t.charAt(j)) {
		    count++;
		}
	    }
	    if (count < min) {
		min = count;
	    }
	}
	System.out.print(min);
    }
} Main public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	String s = sc.next();
	String t = sc.next();
	int min = Integer.MAX_VALUE;
	int count = 0;
	for (int i=0; i<=s.length()-t.length(); i++) {
	    String sis = s.substring(i,i+t.length());
	    count = 0;
	    for (int j=0; j<t.length(); j++) {
		if (sis.charAt(j) != t.charAt(j)) {
		    count++;
		}
	    }
	    if (count < min) {
		min = count;
	    }
	}
	System.out.print(min);
    } main {
	Scanner sc = new Scanner(System.in);
	String s = sc.next();
	String t = sc.next();
	int min = Integer.MAX_VALUE;
	int count = 0;
	for (int i=0; i<=s.length()-t.length(); i++) {
	    String sis = s.substring(i,i+t.length());
	    count = 0;
	    for (int j=0; j<t.length(); j++) {
		if (sis.charAt(j) != t.charAt(j)) {
		    count++;
		}
	    }
	    if (count < min) {
		min = count;
	    }
	}
	System.out.print(min);
    } 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 int min = Integer.MAX_VALUE; min Integer.MAX_VALUE Integer Integer.MAX_VALUE int count = 0; count 0 for (int i=0; i<=s.length()-t.length(); i++) {
	    String sis = s.substring(i,i+t.length());
	    count = 0;
	    for (int j=0; j<t.length(); j++) {
		if (sis.charAt(j) != t.charAt(j)) {
		    count++;
		}
	    }
	    if (count < min) {
		min = count;
	    }
	} 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 {
	    String sis = s.substring(i,i+t.length());
	    count = 0;
	    for (int j=0; j<t.length(); j++) {
		if (sis.charAt(j) != t.charAt(j)) {
		    count++;
		}
	    }
	    if (count < min) {
		min = count;
	    }
	} {
	    String sis = s.substring(i,i+t.length());
	    count = 0;
	    for (int j=0; j<t.length(); j++) {
		if (sis.charAt(j) != t.charAt(j)) {
		    count++;
		}
	    }
	    if (count < min) {
		min = count;
	    }
	} String sis = s.substring(i,i+t.length()); sis s.substring(i,i+t.length()) s.substring s i i+t.length() i t.length() t.length t count = 0 count 0 for (int j=0; j<t.length(); j++) {
		if (sis.charAt(j) != t.charAt(j)) {
		    count++;
		}
	    } int j=0; int j=0; j 0 j<t.length() j t.length() t.length t j++ j++ j {
		if (sis.charAt(j) != t.charAt(j)) {
		    count++;
		}
	    } {
		if (sis.charAt(j) != t.charAt(j)) {
		    count++;
		}
	    } if (sis.charAt(j) != t.charAt(j)) {
		    count++;
		} sis.charAt(j) != t.charAt(j) sis.charAt(j) sis.charAt sis j t.charAt(j) t.charAt t j {
		    count++;
		} count++ count if (count < min) {
		min = count;
	    } count < min count min {
		min = count;
	    } min = count min count System.out.print(min) System.out.print System.out System System.out min String[] args args public class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	String s = sc.next();
	String t = sc.next();
	int min = Integer.MAX_VALUE;
	int count = 0;
	for (int i=0; i<=s.length()-t.length(); i++) {
	    String sis = s.substring(i,i+t.length());
	    count = 0;
	    for (int j=0; j<t.length(); j++) {
		if (sis.charAt(j) != t.charAt(j)) {
		    count++;
		}
	    }
	    if (count < min) {
		min = count;
	    }
	}
	System.out.print(min);
    }
} public class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	String s = sc.next();
	String t = sc.next();
	int min = Integer.MAX_VALUE;
	int count = 0;
	for (int i=0; i<=s.length()-t.length(); i++) {
	    String sis = s.substring(i,i+t.length());
	    count = 0;
	    for (int j=0; j<t.length(); j++) {
		if (sis.charAt(j) != t.charAt(j)) {
		    count++;
		}
	    }
	    if (count < min) {
		min = count;
	    }
	}
	System.out.print(min);
    }
} 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();
	int min = Integer.MAX_VALUE;
	int count = 0;
	for (int i=0; i<=s.length()-t.length(); i++) {
	    String sis = s.substring(i,i+t.length());
	    count = 0;
	    for (int j=0; j<t.length(); j++) {
		if (sis.charAt(j) != t.charAt(j)) {
		    count++;
		}
	    }
	    if (count < min) {
		min = count;
	    }
	}
	System.out.print(min);
    }
}
