import java.util.Scanner;

public class Main {
	private static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);
		String s = sc.next();
		//部分文字列対象
		String t = sc.next();
		
		int slength = s.length();
		int tlength = t.length();
		
		String[] tArray = t.split("");
		int result = slength;
		for (int i = 0; i<= (slength - tlength); i++) {
			String subS = s.substring(i,tlength + i);
			String[] subSArray = subS.split("");
			int innerResult = 0;
			for (int j = 0; j<subS.length(); j++) {
				String subTChar = tArray[j];
				String subSChar = subSArray[j];
				//異なったら変換が必要
				if (!subTChar.equals(subSChar)) {
					innerResult++;
				}
			}
			if (innerResult <= result) {
				result = innerResult;
			}
		}
		System.out.println(result);
	}	

} import java.util.Scanner; Scanner java.util public class Main {
	private static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);
		String s = sc.next();
		//部分文字列対象
		String t = sc.next();
		
		int slength = s.length();
		int tlength = t.length();
		
		String[] tArray = t.split("");
		int result = slength;
		for (int i = 0; i<= (slength - tlength); i++) {
			String subS = s.substring(i,tlength + i);
			String[] subSArray = subS.split("");
			int innerResult = 0;
			for (int j = 0; j<subS.length(); j++) {
				String subTChar = tArray[j];
				String subSChar = subSArray[j];
				//異なったら変換が必要
				if (!subTChar.equals(subSChar)) {
					innerResult++;
				}
			}
			if (innerResult <= result) {
				result = innerResult;
			}
		}
		System.out.println(result);
	}	

} Main private static Scanner sc; sc public static void main(String[] args) {
		sc = new Scanner(System.in);
		String s = sc.next();
		//部分文字列対象
		String t = sc.next();
		
		int slength = s.length();
		int tlength = t.length();
		
		String[] tArray = t.split("");
		int result = slength;
		for (int i = 0; i<= (slength - tlength); i++) {
			String subS = s.substring(i,tlength + i);
			String[] subSArray = subS.split("");
			int innerResult = 0;
			for (int j = 0; j<subS.length(); j++) {
				String subTChar = tArray[j];
				String subSChar = subSArray[j];
				//異なったら変換が必要
				if (!subTChar.equals(subSChar)) {
					innerResult++;
				}
			}
			if (innerResult <= result) {
				result = innerResult;
			}
		}
		System.out.println(result);
	} main {
		sc = new Scanner(System.in);
		String s = sc.next();
		//部分文字列対象
		String t = sc.next();
		
		int slength = s.length();
		int tlength = t.length();
		
		String[] tArray = t.split("");
		int result = slength;
		for (int i = 0; i<= (slength - tlength); i++) {
			String subS = s.substring(i,tlength + i);
			String[] subSArray = subS.split("");
			int innerResult = 0;
			for (int j = 0; j<subS.length(); j++) {
				String subTChar = tArray[j];
				String subSChar = subSArray[j];
				//異なったら変換が必要
				if (!subTChar.equals(subSChar)) {
					innerResult++;
				}
			}
			if (innerResult <= result) {
				result = innerResult;
			}
		}
		System.out.println(result);
	} 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 slength = s.length(); slength s.length() s.length s int tlength = t.length(); tlength t.length() t.length t String[] tArray = t.split(""); tArray t.split("") t.split t "" int result = slength; result slength for (int i = 0; i<= (slength - tlength); i++) {
			String subS = s.substring(i,tlength + i);
			String[] subSArray = subS.split("");
			int innerResult = 0;
			for (int j = 0; j<subS.length(); j++) {
				String subTChar = tArray[j];
				String subSChar = subSArray[j];
				//異なったら変換が必要
				if (!subTChar.equals(subSChar)) {
					innerResult++;
				}
			}
			if (innerResult <= result) {
				result = innerResult;
			}
		} int i = 0; int i = 0; i 0 i<= (slength - tlength) i (slength - tlength) slength tlength i++ i++ i {
			String subS = s.substring(i,tlength + i);
			String[] subSArray = subS.split("");
			int innerResult = 0;
			for (int j = 0; j<subS.length(); j++) {
				String subTChar = tArray[j];
				String subSChar = subSArray[j];
				//異なったら変換が必要
				if (!subTChar.equals(subSChar)) {
					innerResult++;
				}
			}
			if (innerResult <= result) {
				result = innerResult;
			}
		} {
			String subS = s.substring(i,tlength + i);
			String[] subSArray = subS.split("");
			int innerResult = 0;
			for (int j = 0; j<subS.length(); j++) {
				String subTChar = tArray[j];
				String subSChar = subSArray[j];
				//異なったら変換が必要
				if (!subTChar.equals(subSChar)) {
					innerResult++;
				}
			}
			if (innerResult <= result) {
				result = innerResult;
			}
		} String subS = s.substring(i,tlength + i); subS s.substring(i,tlength + i) s.substring s i tlength + i tlength i String[] subSArray = subS.split(""); subSArray subS.split("") subS.split subS "" int innerResult = 0; innerResult 0 for (int j = 0; j<subS.length(); j++) {
				String subTChar = tArray[j];
				String subSChar = subSArray[j];
				//異なったら変換が必要
				if (!subTChar.equals(subSChar)) {
					innerResult++;
				}
			} int j = 0; int j = 0; j 0 j<subS.length() j subS.length() subS.length subS j++ j++ j {
				String subTChar = tArray[j];
				String subSChar = subSArray[j];
				//異なったら変換が必要
				if (!subTChar.equals(subSChar)) {
					innerResult++;
				}
			} {
				String subTChar = tArray[j];
				String subSChar = subSArray[j];
				//異なったら変換が必要
				if (!subTChar.equals(subSChar)) {
					innerResult++;
				}
			} String subTChar = tArray[j]; subTChar tArray[j] tArray j String subSChar = subSArray[j]; subSChar subSArray[j] subSArray j if (!subTChar.equals(subSChar)) {
					innerResult++;
				} !subTChar.equals(subSChar) subTChar.equals(subSChar) subTChar.equals subTChar subSChar {
					innerResult++;
				} innerResult++ innerResult if (innerResult <= result) {
				result = innerResult;
			} innerResult <= result innerResult result {
				result = innerResult;
			} result = innerResult result innerResult System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
	private static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);
		String s = sc.next();
		//部分文字列対象
		String t = sc.next();
		
		int slength = s.length();
		int tlength = t.length();
		
		String[] tArray = t.split("");
		int result = slength;
		for (int i = 0; i<= (slength - tlength); i++) {
			String subS = s.substring(i,tlength + i);
			String[] subSArray = subS.split("");
			int innerResult = 0;
			for (int j = 0; j<subS.length(); j++) {
				String subTChar = tArray[j];
				String subSChar = subSArray[j];
				//異なったら変換が必要
				if (!subTChar.equals(subSChar)) {
					innerResult++;
				}
			}
			if (innerResult <= result) {
				result = innerResult;
			}
		}
		System.out.println(result);
	}	

} public class Main {
	private static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);
		String s = sc.next();
		//部分文字列対象
		String t = sc.next();
		
		int slength = s.length();
		int tlength = t.length();
		
		String[] tArray = t.split("");
		int result = slength;
		for (int i = 0; i<= (slength - tlength); i++) {
			String subS = s.substring(i,tlength + i);
			String[] subSArray = subS.split("");
			int innerResult = 0;
			for (int j = 0; j<subS.length(); j++) {
				String subTChar = tArray[j];
				String subSChar = subSArray[j];
				//異なったら変換が必要
				if (!subTChar.equals(subSChar)) {
					innerResult++;
				}
			}
			if (innerResult <= result) {
				result = innerResult;
			}
		}
		System.out.println(result);
	}	

} Main
import java.util.Scanner;

public class Main {
	private static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);
		String s = sc.next();
		//部分文字列対象
		String t = sc.next();
		
		int slength = s.length();
		int tlength = t.length();
		
		String[] tArray = t.split("");
		int result = slength;
		for (int i = 0; i<= (slength - tlength); i++) {
			String subS = s.substring(i,tlength + i);
			String[] subSArray = subS.split("");
			int innerResult = 0;
			for (int j = 0; j<subS.length(); j++) {
				String subTChar = tArray[j];
				String subSChar = subSArray[j];
				//異なったら変換が必要
				if (!subTChar.equals(subSChar)) {
					innerResult++;
				}
			}
			if (innerResult <= result) {
				result = innerResult;
			}
		}
		System.out.println(result);
	}	

}
