import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		String S = sc.next();
		String T = sc.next();

		char[] s = S.toCharArray();
		char[] t = T.toCharArray();

		int ls = S.length();
		int lt = T.length();

		int ans = lt;

		for(int i=0;i<=ls-lt;i++) {
			int cnt = 0;
			for(int j=0;j<lt;j++) {
					if(t[j]!=s[i+j]) {
						cnt++;
					}
			}
			if(cnt<ans) {
				ans = cnt;
			}
		}
		System.out.println(ans);
	}
} import java.io.FileNotFoundException; FileNotFoundException java.io import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		String S = sc.next();
		String T = sc.next();

		char[] s = S.toCharArray();
		char[] t = T.toCharArray();

		int ls = S.length();
		int lt = T.length();

		int ans = lt;

		for(int i=0;i<=ls-lt;i++) {
			int cnt = 0;
			for(int j=0;j<lt;j++) {
					if(t[j]!=s[i+j]) {
						cnt++;
					}
			}
			if(cnt<ans) {
				ans = cnt;
			}
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		String S = sc.next();
		String T = sc.next();

		char[] s = S.toCharArray();
		char[] t = T.toCharArray();

		int ls = S.length();
		int lt = T.length();

		int ans = lt;

		for(int i=0;i<=ls-lt;i++) {
			int cnt = 0;
			for(int j=0;j<lt;j++) {
					if(t[j]!=s[i+j]) {
						cnt++;
					}
			}
			if(cnt<ans) {
				ans = cnt;
			}
		}
		System.out.println(ans);
	} main {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		String S = sc.next();
		String T = sc.next();

		char[] s = S.toCharArray();
		char[] t = T.toCharArray();

		int ls = S.length();
		int lt = T.length();

		int ans = lt;

		for(int i=0;i<=ls-lt;i++) {
			int cnt = 0;
			for(int j=0;j<lt;j++) {
					if(t[j]!=s[i+j]) {
						cnt++;
					}
			}
			if(cnt<ans) {
				ans = cnt;
			}
		}
		System.out.println(ans);
	} 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 char[] s = S.toCharArray(); s S.toCharArray() S.toCharArray S char[] t = T.toCharArray(); t T.toCharArray() T.toCharArray T int ls = S.length(); ls S.length() S.length S int lt = T.length(); lt T.length() T.length T int ans = lt; ans lt for(int i=0;i<=ls-lt;i++) {
			int cnt = 0;
			for(int j=0;j<lt;j++) {
					if(t[j]!=s[i+j]) {
						cnt++;
					}
			}
			if(cnt<ans) {
				ans = cnt;
			}
		} int i=0; int i=0; i 0 i<=ls-lt i ls-lt ls lt i++ i++ i {
			int cnt = 0;
			for(int j=0;j<lt;j++) {
					if(t[j]!=s[i+j]) {
						cnt++;
					}
			}
			if(cnt<ans) {
				ans = cnt;
			}
		} {
			int cnt = 0;
			for(int j=0;j<lt;j++) {
					if(t[j]!=s[i+j]) {
						cnt++;
					}
			}
			if(cnt<ans) {
				ans = cnt;
			}
		} int cnt = 0; cnt 0 for(int j=0;j<lt;j++) {
					if(t[j]!=s[i+j]) {
						cnt++;
					}
			} int j=0; int j=0; j 0 j<lt j lt j++ j++ j {
					if(t[j]!=s[i+j]) {
						cnt++;
					}
			} {
					if(t[j]!=s[i+j]) {
						cnt++;
					}
			} if(t[j]!=s[i+j]) {
						cnt++;
					} t[j]!=s[i+j] t[j] t j s[i+j] s i+j i j {
						cnt++;
					} cnt++ cnt if(cnt<ans) {
				ans = cnt;
			} cnt<ans cnt ans {
				ans = cnt;
			} ans = cnt ans cnt System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		String S = sc.next();
		String T = sc.next();

		char[] s = S.toCharArray();
		char[] t = T.toCharArray();

		int ls = S.length();
		int lt = T.length();

		int ans = lt;

		for(int i=0;i<=ls-lt;i++) {
			int cnt = 0;
			for(int j=0;j<lt;j++) {
					if(t[j]!=s[i+j]) {
						cnt++;
					}
			}
			if(cnt<ans) {
				ans = cnt;
			}
		}
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		String S = sc.next();
		String T = sc.next();

		char[] s = S.toCharArray();
		char[] t = T.toCharArray();

		int ls = S.length();
		int lt = T.length();

		int ans = lt;

		for(int i=0;i<=ls-lt;i++) {
			int cnt = 0;
			for(int j=0;j<lt;j++) {
					if(t[j]!=s[i+j]) {
						cnt++;
					}
			}
			if(cnt<ans) {
				ans = cnt;
			}
		}
		System.out.println(ans);
	}
} Main
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		String S = sc.next();
		String T = sc.next();

		char[] s = S.toCharArray();
		char[] t = T.toCharArray();

		int ls = S.length();
		int lt = T.length();

		int ans = lt;

		for(int i=0;i<=ls-lt;i++) {
			int cnt = 0;
			for(int j=0;j<lt;j++) {
					if(t[j]!=s[i+j]) {
						cnt++;
					}
			}
			if(cnt<ans) {
				ans = cnt;
			}
		}
		System.out.println(ans);
	}
}