import java.util.Scanner;
import java.util.Arrays;
import java.util.List;

public class Main {
	public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
		String inputS = sc.nextLine();
		String[] inputT = sc.nextLine().split("");
		int minReplaceCount = inputT.length;
		// 切り出す頭の位置
		for (int i=0; i+inputT.length<=inputS.length(); i++) {
			// 検索する文字列を切り出す
			String[] targetStr = inputS.substring(i, i+inputT.length).split("");
			int replaceStrCount = 0;
			for (int j=0; j<targetStr.length; j++) {
				if (!targetStr[j].equals(inputT[j])) replaceStrCount++;
			}
			if (minReplaceCount > replaceStrCount) minReplaceCount = replaceStrCount;
		}
		System.out.println(minReplaceCount);
	}
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util import java.util.List; List java.util public class Main {
	public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
		String inputS = sc.nextLine();
		String[] inputT = sc.nextLine().split("");
		int minReplaceCount = inputT.length;
		// 切り出す頭の位置
		for (int i=0; i+inputT.length<=inputS.length(); i++) {
			// 検索する文字列を切り出す
			String[] targetStr = inputS.substring(i, i+inputT.length).split("");
			int replaceStrCount = 0;
			for (int j=0; j<targetStr.length; j++) {
				if (!targetStr[j].equals(inputT[j])) replaceStrCount++;
			}
			if (minReplaceCount > replaceStrCount) minReplaceCount = replaceStrCount;
		}
		System.out.println(minReplaceCount);
	}
} Main public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
		String inputS = sc.nextLine();
		String[] inputT = sc.nextLine().split("");
		int minReplaceCount = inputT.length;
		// 切り出す頭の位置
		for (int i=0; i+inputT.length<=inputS.length(); i++) {
			// 検索する文字列を切り出す
			String[] targetStr = inputS.substring(i, i+inputT.length).split("");
			int replaceStrCount = 0;
			for (int j=0; j<targetStr.length; j++) {
				if (!targetStr[j].equals(inputT[j])) replaceStrCount++;
			}
			if (minReplaceCount > replaceStrCount) minReplaceCount = replaceStrCount;
		}
		System.out.println(minReplaceCount);
	} main {
	    Scanner sc = new Scanner(System.in);
		String inputS = sc.nextLine();
		String[] inputT = sc.nextLine().split("");
		int minReplaceCount = inputT.length;
		// 切り出す頭の位置
		for (int i=0; i+inputT.length<=inputS.length(); i++) {
			// 検索する文字列を切り出す
			String[] targetStr = inputS.substring(i, i+inputT.length).split("");
			int replaceStrCount = 0;
			for (int j=0; j<targetStr.length; j++) {
				if (!targetStr[j].equals(inputT[j])) replaceStrCount++;
			}
			if (minReplaceCount > replaceStrCount) minReplaceCount = replaceStrCount;
		}
		System.out.println(minReplaceCount);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String inputS = sc.nextLine(); inputS sc.nextLine() sc.nextLine sc String[] inputT = sc.nextLine().split(""); inputT sc.nextLine().split("") sc.nextLine().split sc.nextLine() sc.nextLine sc "" int minReplaceCount = inputT.length; minReplaceCount inputT.length inputT inputT.length for (int i=0; i+inputT.length<=inputS.length(); i++) {
			// 検索する文字列を切り出す
			String[] targetStr = inputS.substring(i, i+inputT.length).split("");
			int replaceStrCount = 0;
			for (int j=0; j<targetStr.length; j++) {
				if (!targetStr[j].equals(inputT[j])) replaceStrCount++;
			}
			if (minReplaceCount > replaceStrCount) minReplaceCount = replaceStrCount;
		} int i=0; int i=0; i 0 i+inputT.length<=inputS.length() i+inputT.length i inputT.length inputT inputT.length inputS.length() inputS.length inputS i++ i++ i {
			// 検索する文字列を切り出す
			String[] targetStr = inputS.substring(i, i+inputT.length).split("");
			int replaceStrCount = 0;
			for (int j=0; j<targetStr.length; j++) {
				if (!targetStr[j].equals(inputT[j])) replaceStrCount++;
			}
			if (minReplaceCount > replaceStrCount) minReplaceCount = replaceStrCount;
		} {
			// 検索する文字列を切り出す
			String[] targetStr = inputS.substring(i, i+inputT.length).split("");
			int replaceStrCount = 0;
			for (int j=0; j<targetStr.length; j++) {
				if (!targetStr[j].equals(inputT[j])) replaceStrCount++;
			}
			if (minReplaceCount > replaceStrCount) minReplaceCount = replaceStrCount;
		} String[] targetStr = inputS.substring(i, i+inputT.length).split(""); targetStr inputS.substring(i, i+inputT.length).split("") inputS.substring(i, i+inputT.length).split inputS.substring(i, i+inputT.length) inputS.substring inputS i i+inputT.length i inputT.length inputT inputT.length "" int replaceStrCount = 0; replaceStrCount 0 for (int j=0; j<targetStr.length; j++) {
				if (!targetStr[j].equals(inputT[j])) replaceStrCount++;
			} int j=0; int j=0; j 0 j<targetStr.length j targetStr.length targetStr targetStr.length j++ j++ j {
				if (!targetStr[j].equals(inputT[j])) replaceStrCount++;
			} {
				if (!targetStr[j].equals(inputT[j])) replaceStrCount++;
			} if (!targetStr[j].equals(inputT[j])) replaceStrCount++; !targetStr[j].equals(inputT[j]) targetStr[j].equals(inputT[j]) targetStr[j].equals targetStr[j] targetStr j inputT[j] inputT j replaceStrCount++ replaceStrCount if (minReplaceCount > replaceStrCount) minReplaceCount = replaceStrCount; minReplaceCount > replaceStrCount minReplaceCount replaceStrCount minReplaceCount = replaceStrCount minReplaceCount replaceStrCount System.out.println(minReplaceCount) System.out.println System.out System System.out minReplaceCount String[] args args public class Main {
	public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
		String inputS = sc.nextLine();
		String[] inputT = sc.nextLine().split("");
		int minReplaceCount = inputT.length;
		// 切り出す頭の位置
		for (int i=0; i+inputT.length<=inputS.length(); i++) {
			// 検索する文字列を切り出す
			String[] targetStr = inputS.substring(i, i+inputT.length).split("");
			int replaceStrCount = 0;
			for (int j=0; j<targetStr.length; j++) {
				if (!targetStr[j].equals(inputT[j])) replaceStrCount++;
			}
			if (minReplaceCount > replaceStrCount) minReplaceCount = replaceStrCount;
		}
		System.out.println(minReplaceCount);
	}
} public class Main {
	public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
		String inputS = sc.nextLine();
		String[] inputT = sc.nextLine().split("");
		int minReplaceCount = inputT.length;
		// 切り出す頭の位置
		for (int i=0; i+inputT.length<=inputS.length(); i++) {
			// 検索する文字列を切り出す
			String[] targetStr = inputS.substring(i, i+inputT.length).split("");
			int replaceStrCount = 0;
			for (int j=0; j<targetStr.length; j++) {
				if (!targetStr[j].equals(inputT[j])) replaceStrCount++;
			}
			if (minReplaceCount > replaceStrCount) minReplaceCount = replaceStrCount;
		}
		System.out.println(minReplaceCount);
	}
} Main
import java.util.Scanner;
import java.util.Arrays;
import java.util.List;

public class Main {
	public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
		String inputS = sc.nextLine();
		String[] inputT = sc.nextLine().split("");
		int minReplaceCount = inputT.length;
		// 切り出す頭の位置
		for (int i=0; i+inputT.length<=inputS.length(); i++) {
			// 検索する文字列を切り出す
			String[] targetStr = inputS.substring(i, i+inputT.length).split("");
			int replaceStrCount = 0;
			for (int j=0; j<targetStr.length; j++) {
				if (!targetStr[j].equals(inputT[j])) replaceStrCount++;
			}
			if (minReplaceCount > replaceStrCount) minReplaceCount = replaceStrCount;
		}
		System.out.println(minReplaceCount);
	}
}
