import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		
		String s = scan.next();
		String t = scan.next();
		
		String[] s1 = s.split("");
		String[] t1 = t.split("");
		
		if(s1.length == t1.length) {
			int ans1 = s1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(s1[i].equals(t1[i])) {
					ans1--;
				}
			}
			
			System.out.print(ans1);
			return;
		}
		
		int[] ans = new int[s1.length-t1.length-1];
		
		for(int j = 1; j < s1.length-t1.length; j++) {
			
			String str = s.substring(j, j+t1.length);
			//System.out.println(str);
			String[] str1 = str.split("");
			
			ans[j-1] = t1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(str1[i].equals(t1[i])) {
					ans[j-1]--;
				}
			}
		}
		
		int sm = 10000000;
		
		for(int i = 0; i < ans.length; i++) {
			//System.out.println(ans[i]);
			if(ans[i] < sm) {
				sm = ans[i];
			}
		}
		
		System.out.print(sm);

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		
		String s = scan.next();
		String t = scan.next();
		
		String[] s1 = s.split("");
		String[] t1 = t.split("");
		
		if(s1.length == t1.length) {
			int ans1 = s1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(s1[i].equals(t1[i])) {
					ans1--;
				}
			}
			
			System.out.print(ans1);
			return;
		}
		
		int[] ans = new int[s1.length-t1.length-1];
		
		for(int j = 1; j < s1.length-t1.length; j++) {
			
			String str = s.substring(j, j+t1.length);
			//System.out.println(str);
			String[] str1 = str.split("");
			
			ans[j-1] = t1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(str1[i].equals(t1[i])) {
					ans[j-1]--;
				}
			}
		}
		
		int sm = 10000000;
		
		for(int i = 0; i < ans.length; i++) {
			//System.out.println(ans[i]);
			if(ans[i] < sm) {
				sm = ans[i];
			}
		}
		
		System.out.print(sm);

	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		
		String s = scan.next();
		String t = scan.next();
		
		String[] s1 = s.split("");
		String[] t1 = t.split("");
		
		if(s1.length == t1.length) {
			int ans1 = s1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(s1[i].equals(t1[i])) {
					ans1--;
				}
			}
			
			System.out.print(ans1);
			return;
		}
		
		int[] ans = new int[s1.length-t1.length-1];
		
		for(int j = 1; j < s1.length-t1.length; j++) {
			
			String str = s.substring(j, j+t1.length);
			//System.out.println(str);
			String[] str1 = str.split("");
			
			ans[j-1] = t1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(str1[i].equals(t1[i])) {
					ans[j-1]--;
				}
			}
		}
		
		int sm = 10000000;
		
		for(int i = 0; i < ans.length; i++) {
			//System.out.println(ans[i]);
			if(ans[i] < sm) {
				sm = ans[i];
			}
		}
		
		System.out.print(sm);

	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		
		String s = scan.next();
		String t = scan.next();
		
		String[] s1 = s.split("");
		String[] t1 = t.split("");
		
		if(s1.length == t1.length) {
			int ans1 = s1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(s1[i].equals(t1[i])) {
					ans1--;
				}
			}
			
			System.out.print(ans1);
			return;
		}
		
		int[] ans = new int[s1.length-t1.length-1];
		
		for(int j = 1; j < s1.length-t1.length; j++) {
			
			String str = s.substring(j, j+t1.length);
			//System.out.println(str);
			String[] str1 = str.split("");
			
			ans[j-1] = t1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(str1[i].equals(t1[i])) {
					ans[j-1]--;
				}
			}
		}
		
		int sm = 10000000;
		
		for(int i = 0; i < ans.length; i++) {
			//System.out.println(ans[i]);
			if(ans[i] < sm) {
				sm = ans[i];
			}
		}
		
		System.out.print(sm);

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String s = scan.next(); s scan.next() scan.next scan String t = scan.next(); t scan.next() scan.next scan String[] s1 = s.split(""); s1 s.split("") s.split s "" String[] t1 = t.split(""); t1 t.split("") t.split t "" if(s1.length == t1.length) {
			int ans1 = s1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(s1[i].equals(t1[i])) {
					ans1--;
				}
			}
			
			System.out.print(ans1);
			return;
		} s1.length == t1.length s1.length s1 s1.length t1.length t1 t1.length {
			int ans1 = s1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(s1[i].equals(t1[i])) {
					ans1--;
				}
			}
			
			System.out.print(ans1);
			return;
		} int ans1 = s1.length; ans1 s1.length s1 s1.length for(int i = 0; i < t1.length; i++) {
				
				if(s1[i].equals(t1[i])) {
					ans1--;
				}
			} int i = 0; int i = 0; i 0 i < t1.length i t1.length t1 t1.length i++ i++ i {
				
				if(s1[i].equals(t1[i])) {
					ans1--;
				}
			} {
				
				if(s1[i].equals(t1[i])) {
					ans1--;
				}
			} if(s1[i].equals(t1[i])) {
					ans1--;
				} s1[i].equals(t1[i]) s1[i].equals s1[i] s1 i t1[i] t1 i {
					ans1--;
				} ans1-- ans1 System.out.print(ans1) System.out.print System.out System System.out ans1 return; int[] ans = new int[s1.length-t1.length-1]; ans new int[s1.length-t1.length-1] s1.length-t1.length-1 s1.length-t1.length-1 s1.length s1 s1.length t1.length t1 t1.length 1 for(int j = 1; j < s1.length-t1.length; j++) {
			
			String str = s.substring(j, j+t1.length);
			//System.out.println(str);
			String[] str1 = str.split("");
			
			ans[j-1] = t1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(str1[i].equals(t1[i])) {
					ans[j-1]--;
				}
			}
		} int j = 1; int j = 1; j 1 j < s1.length-t1.length j s1.length-t1.length s1.length s1 s1.length t1.length t1 t1.length j++ j++ j {
			
			String str = s.substring(j, j+t1.length);
			//System.out.println(str);
			String[] str1 = str.split("");
			
			ans[j-1] = t1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(str1[i].equals(t1[i])) {
					ans[j-1]--;
				}
			}
		} {
			
			String str = s.substring(j, j+t1.length);
			//System.out.println(str);
			String[] str1 = str.split("");
			
			ans[j-1] = t1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(str1[i].equals(t1[i])) {
					ans[j-1]--;
				}
			}
		} String str = s.substring(j, j+t1.length); str s.substring(j, j+t1.length) s.substring s j j+t1.length j t1.length t1 t1.length String[] str1 = str.split(""); str1 str.split("") str.split str "" ans[j-1] = t1.length ans[j-1] ans j-1 j 1 t1.length t1 t1.length for(int i = 0; i < t1.length; i++) {
				
				if(str1[i].equals(t1[i])) {
					ans[j-1]--;
				}
			} int i = 0; int i = 0; i 0 i < t1.length i t1.length t1 t1.length i++ i++ i {
				
				if(str1[i].equals(t1[i])) {
					ans[j-1]--;
				}
			} {
				
				if(str1[i].equals(t1[i])) {
					ans[j-1]--;
				}
			} if(str1[i].equals(t1[i])) {
					ans[j-1]--;
				} str1[i].equals(t1[i]) str1[i].equals str1[i] str1 i t1[i] t1 i {
					ans[j-1]--;
				} ans[j-1]-- ans[j-1] ans j-1 j 1 int sm = 10000000; sm 10000000 for(int i = 0; i < ans.length; i++) {
			//System.out.println(ans[i]);
			if(ans[i] < sm) {
				sm = ans[i];
			}
		} int i = 0; int i = 0; i 0 i < ans.length i ans.length ans ans.length i++ i++ i {
			//System.out.println(ans[i]);
			if(ans[i] < sm) {
				sm = ans[i];
			}
		} {
			//System.out.println(ans[i]);
			if(ans[i] < sm) {
				sm = ans[i];
			}
		} if(ans[i] < sm) {
				sm = ans[i];
			} ans[i] < sm ans[i] ans i sm {
				sm = ans[i];
			} sm = ans[i] sm ans[i] ans i System.out.print(sm) System.out.print System.out System System.out sm String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		
		String s = scan.next();
		String t = scan.next();
		
		String[] s1 = s.split("");
		String[] t1 = t.split("");
		
		if(s1.length == t1.length) {
			int ans1 = s1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(s1[i].equals(t1[i])) {
					ans1--;
				}
			}
			
			System.out.print(ans1);
			return;
		}
		
		int[] ans = new int[s1.length-t1.length-1];
		
		for(int j = 1; j < s1.length-t1.length; j++) {
			
			String str = s.substring(j, j+t1.length);
			//System.out.println(str);
			String[] str1 = str.split("");
			
			ans[j-1] = t1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(str1[i].equals(t1[i])) {
					ans[j-1]--;
				}
			}
		}
		
		int sm = 10000000;
		
		for(int i = 0; i < ans.length; i++) {
			//System.out.println(ans[i]);
			if(ans[i] < sm) {
				sm = ans[i];
			}
		}
		
		System.out.print(sm);

	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		
		String s = scan.next();
		String t = scan.next();
		
		String[] s1 = s.split("");
		String[] t1 = t.split("");
		
		if(s1.length == t1.length) {
			int ans1 = s1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(s1[i].equals(t1[i])) {
					ans1--;
				}
			}
			
			System.out.print(ans1);
			return;
		}
		
		int[] ans = new int[s1.length-t1.length-1];
		
		for(int j = 1; j < s1.length-t1.length; j++) {
			
			String str = s.substring(j, j+t1.length);
			//System.out.println(str);
			String[] str1 = str.split("");
			
			ans[j-1] = t1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(str1[i].equals(t1[i])) {
					ans[j-1]--;
				}
			}
		}
		
		int sm = 10000000;
		
		for(int i = 0; i < ans.length; i++) {
			//System.out.println(ans[i]);
			if(ans[i] < sm) {
				sm = ans[i];
			}
		}
		
		System.out.print(sm);

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		
		String s = scan.next();
		String t = scan.next();
		
		String[] s1 = s.split("");
		String[] t1 = t.split("");
		
		if(s1.length == t1.length) {
			int ans1 = s1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(s1[i].equals(t1[i])) {
					ans1--;
				}
			}
			
			System.out.print(ans1);
			return;
		}
		
		int[] ans = new int[s1.length-t1.length-1];
		
		for(int j = 1; j < s1.length-t1.length; j++) {
			
			String str = s.substring(j, j+t1.length);
			//System.out.println(str);
			String[] str1 = str.split("");
			
			ans[j-1] = t1.length;
			
			for(int i = 0; i < t1.length; i++) {
				
				if(str1[i].equals(t1[i])) {
					ans[j-1]--;
				}
			}
		}
		
		int sm = 10000000;
		
		for(int i = 0; i < ans.length; i++) {
			//System.out.println(ans[i]);
			if(ans[i] < sm) {
				sm = ans[i];
			}
		}
		
		System.out.print(sm);

	}

}