
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			String s = sc.next();
			String t = sc.next();
			char[] sArr = s.toCharArray();
			char[] tArr = t.toCharArray();

			int result = Integer.MAX_VALUE;
			for (int i = 0; i < s.length() - t.length() + 1; i++) {
				int tmp = 0;
				for (int j = 0; j < t.length(); j++) {
					if(sArr[i + j] != tArr[j]) {
						tmp++;
					}
				}
				if (tmp < result) {
					result = tmp;
				}
			}
			System.out.println(result);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			String s = sc.next();
			String t = sc.next();
			char[] sArr = s.toCharArray();
			char[] tArr = t.toCharArray();

			int result = Integer.MAX_VALUE;
			for (int i = 0; i < s.length() - t.length() + 1; i++) {
				int tmp = 0;
				for (int j = 0; j < t.length(); j++) {
					if(sArr[i + j] != tArr[j]) {
						tmp++;
					}
				}
				if (tmp < result) {
					result = tmp;
				}
			}
			System.out.println(result);
		}
	}
} Main public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			String s = sc.next();
			String t = sc.next();
			char[] sArr = s.toCharArray();
			char[] tArr = t.toCharArray();

			int result = Integer.MAX_VALUE;
			for (int i = 0; i < s.length() - t.length() + 1; i++) {
				int tmp = 0;
				for (int j = 0; j < t.length(); j++) {
					if(sArr[i + j] != tArr[j]) {
						tmp++;
					}
				}
				if (tmp < result) {
					result = tmp;
				}
			}
			System.out.println(result);
		}
	} main {
		try (Scanner sc = new Scanner(System.in)) {
			String s = sc.next();
			String t = sc.next();
			char[] sArr = s.toCharArray();
			char[] tArr = t.toCharArray();

			int result = Integer.MAX_VALUE;
			for (int i = 0; i < s.length() - t.length() + 1; i++) {
				int tmp = 0;
				for (int j = 0; j < t.length(); j++) {
					if(sArr[i + j] != tArr[j]) {
						tmp++;
					}
				}
				if (tmp < result) {
					result = tmp;
				}
			}
			System.out.println(result);
		}
	} try (Scanner sc = new Scanner(System.in)) {
			String s = sc.next();
			String t = sc.next();
			char[] sArr = s.toCharArray();
			char[] tArr = t.toCharArray();

			int result = Integer.MAX_VALUE;
			for (int i = 0; i < s.length() - t.length() + 1; i++) {
				int tmp = 0;
				for (int j = 0; j < t.length(); j++) {
					if(sArr[i + j] != tArr[j]) {
						tmp++;
					}
				}
				if (tmp < result) {
					result = tmp;
				}
			}
			System.out.println(result);
		} {
			String s = sc.next();
			String t = sc.next();
			char[] sArr = s.toCharArray();
			char[] tArr = t.toCharArray();

			int result = Integer.MAX_VALUE;
			for (int i = 0; i < s.length() - t.length() + 1; i++) {
				int tmp = 0;
				for (int j = 0; j < t.length(); j++) {
					if(sArr[i + j] != tArr[j]) {
						tmp++;
					}
				}
				if (tmp < result) {
					result = tmp;
				}
			}
			System.out.println(result);
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String t = sc.next(); t sc.next() sc.next sc char[] sArr = s.toCharArray(); sArr s.toCharArray() s.toCharArray s char[] tArr = t.toCharArray(); tArr t.toCharArray() t.toCharArray t int result = Integer.MAX_VALUE; result Integer.MAX_VALUE Integer Integer.MAX_VALUE for (int i = 0; i < s.length() - t.length() + 1; i++) {
				int tmp = 0;
				for (int j = 0; j < t.length(); j++) {
					if(sArr[i + j] != tArr[j]) {
						tmp++;
					}
				}
				if (tmp < result) {
					result = tmp;
				}
			} int i = 0; int i = 0; i 0 i < s.length() - t.length() + 1 i s.length() - t.length() + 1 s.length() - t.length() s.length() s.length s t.length() t.length t 1 i++ i++ i {
				int tmp = 0;
				for (int j = 0; j < t.length(); j++) {
					if(sArr[i + j] != tArr[j]) {
						tmp++;
					}
				}
				if (tmp < result) {
					result = tmp;
				}
			} {
				int tmp = 0;
				for (int j = 0; j < t.length(); j++) {
					if(sArr[i + j] != tArr[j]) {
						tmp++;
					}
				}
				if (tmp < result) {
					result = tmp;
				}
			} int tmp = 0; tmp 0 for (int j = 0; j < t.length(); j++) {
					if(sArr[i + j] != tArr[j]) {
						tmp++;
					}
				} int j = 0; int j = 0; j 0 j < t.length() j t.length() t.length t j++ j++ j {
					if(sArr[i + j] != tArr[j]) {
						tmp++;
					}
				} {
					if(sArr[i + j] != tArr[j]) {
						tmp++;
					}
				} if(sArr[i + j] != tArr[j]) {
						tmp++;
					} sArr[i + j] != tArr[j] sArr[i + j] sArr i + j i j tArr[j] tArr j {
						tmp++;
					} tmp++ tmp if (tmp < result) {
					result = tmp;
				} tmp < result tmp result {
					result = tmp;
				} result = tmp result tmp System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			String s = sc.next();
			String t = sc.next();
			char[] sArr = s.toCharArray();
			char[] tArr = t.toCharArray();

			int result = Integer.MAX_VALUE;
			for (int i = 0; i < s.length() - t.length() + 1; i++) {
				int tmp = 0;
				for (int j = 0; j < t.length(); j++) {
					if(sArr[i + j] != tArr[j]) {
						tmp++;
					}
				}
				if (tmp < result) {
					result = tmp;
				}
			}
			System.out.println(result);
		}
	}
} public class Main {

	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			String s = sc.next();
			String t = sc.next();
			char[] sArr = s.toCharArray();
			char[] tArr = t.toCharArray();

			int result = Integer.MAX_VALUE;
			for (int i = 0; i < s.length() - t.length() + 1; i++) {
				int tmp = 0;
				for (int j = 0; j < t.length(); j++) {
					if(sArr[i + j] != tArr[j]) {
						tmp++;
					}
				}
				if (tmp < result) {
					result = tmp;
				}
			}
			System.out.println(result);
		}
	}
} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			String s = sc.next();
			String t = sc.next();
			char[] sArr = s.toCharArray();
			char[] tArr = t.toCharArray();

			int result = Integer.MAX_VALUE;
			for (int i = 0; i < s.length() - t.length() + 1; i++) {
				int tmp = 0;
				for (int j = 0; j < t.length(); j++) {
					if(sArr[i + j] != tArr[j]) {
						tmp++;
					}
				}
				if (tmp < result) {
					result = tmp;
				}
			}
			System.out.println(result);
		}
	}
}
