import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner s = new Scanner(System.in);
		
		String ss = s.nextLine();
		String t = s.nextLine();
		
		int minS = Integer.MAX_VALUE;
		int tmpS = 0;
		
		for(int i = 0; i + t.length() <= ss.length(); i++) {
			
			String tmp = ss.substring(i, i + t.length());
			tmpS = 0;
			
			for(int j = 0; j < tmp.length(); j++) {
				
				if(tmp.charAt(j) != t.charAt(j))
					tmpS++;
				
			}
			
			if(tmpS < minS)
				minS = tmpS;
			
		}
		
		System.out.println(minS);
		

	}

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

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner s = new Scanner(System.in);
		
		String ss = s.nextLine();
		String t = s.nextLine();
		
		int minS = Integer.MAX_VALUE;
		int tmpS = 0;
		
		for(int i = 0; i + t.length() <= ss.length(); i++) {
			
			String tmp = ss.substring(i, i + t.length());
			tmpS = 0;
			
			for(int j = 0; j < tmp.length(); j++) {
				
				if(tmp.charAt(j) != t.charAt(j))
					tmpS++;
				
			}
			
			if(tmpS < minS)
				minS = tmpS;
			
		}
		
		System.out.println(minS);
		

	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner s = new Scanner(System.in);
		
		String ss = s.nextLine();
		String t = s.nextLine();
		
		int minS = Integer.MAX_VALUE;
		int tmpS = 0;
		
		for(int i = 0; i + t.length() <= ss.length(); i++) {
			
			String tmp = ss.substring(i, i + t.length());
			tmpS = 0;
			
			for(int j = 0; j < tmp.length(); j++) {
				
				if(tmp.charAt(j) != t.charAt(j))
					tmpS++;
				
			}
			
			if(tmpS < minS)
				minS = tmpS;
			
		}
		
		System.out.println(minS);
		

	} main {
		// TODO Auto-generated method stub
		
		Scanner s = new Scanner(System.in);
		
		String ss = s.nextLine();
		String t = s.nextLine();
		
		int minS = Integer.MAX_VALUE;
		int tmpS = 0;
		
		for(int i = 0; i + t.length() <= ss.length(); i++) {
			
			String tmp = ss.substring(i, i + t.length());
			tmpS = 0;
			
			for(int j = 0; j < tmp.length(); j++) {
				
				if(tmp.charAt(j) != t.charAt(j))
					tmpS++;
				
			}
			
			if(tmpS < minS)
				minS = tmpS;
			
		}
		
		System.out.println(minS);
		

	} Scanner s = new Scanner(System.in); s new Scanner(System.in) String ss = s.nextLine(); ss s.nextLine() s.nextLine s String t = s.nextLine(); t s.nextLine() s.nextLine s int minS = Integer.MAX_VALUE; minS Integer.MAX_VALUE Integer Integer.MAX_VALUE int tmpS = 0; tmpS 0 for(int i = 0; i + t.length() <= ss.length(); i++) {
			
			String tmp = ss.substring(i, i + t.length());
			tmpS = 0;
			
			for(int j = 0; j < tmp.length(); j++) {
				
				if(tmp.charAt(j) != t.charAt(j))
					tmpS++;
				
			}
			
			if(tmpS < minS)
				minS = tmpS;
			
		} int i = 0; int i = 0; i 0 i + t.length() <= ss.length() i + t.length() i t.length() t.length t ss.length() ss.length ss i++ i++ i {
			
			String tmp = ss.substring(i, i + t.length());
			tmpS = 0;
			
			for(int j = 0; j < tmp.length(); j++) {
				
				if(tmp.charAt(j) != t.charAt(j))
					tmpS++;
				
			}
			
			if(tmpS < minS)
				minS = tmpS;
			
		} {
			
			String tmp = ss.substring(i, i + t.length());
			tmpS = 0;
			
			for(int j = 0; j < tmp.length(); j++) {
				
				if(tmp.charAt(j) != t.charAt(j))
					tmpS++;
				
			}
			
			if(tmpS < minS)
				minS = tmpS;
			
		} String tmp = ss.substring(i, i + t.length()); tmp ss.substring(i, i + t.length()) ss.substring ss i i + t.length() i t.length() t.length t tmpS = 0 tmpS 0 for(int j = 0; j < tmp.length(); j++) {
				
				if(tmp.charAt(j) != t.charAt(j))
					tmpS++;
				
			} int j = 0; int j = 0; j 0 j < tmp.length() j tmp.length() tmp.length tmp j++ j++ j {
				
				if(tmp.charAt(j) != t.charAt(j))
					tmpS++;
				
			} {
				
				if(tmp.charAt(j) != t.charAt(j))
					tmpS++;
				
			} if(tmp.charAt(j) != t.charAt(j))
					tmpS++; tmp.charAt(j) != t.charAt(j) tmp.charAt(j) tmp.charAt tmp j t.charAt(j) t.charAt t j tmpS++ tmpS if(tmpS < minS)
				minS = tmpS; tmpS < minS tmpS minS minS = tmpS minS tmpS System.out.println(minS) System.out.println System.out System System.out minS String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner s = new Scanner(System.in);
		
		String ss = s.nextLine();
		String t = s.nextLine();
		
		int minS = Integer.MAX_VALUE;
		int tmpS = 0;
		
		for(int i = 0; i + t.length() <= ss.length(); i++) {
			
			String tmp = ss.substring(i, i + t.length());
			tmpS = 0;
			
			for(int j = 0; j < tmp.length(); j++) {
				
				if(tmp.charAt(j) != t.charAt(j))
					tmpS++;
				
			}
			
			if(tmpS < minS)
				minS = tmpS;
			
		}
		
		System.out.println(minS);
		

	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner s = new Scanner(System.in);
		
		String ss = s.nextLine();
		String t = s.nextLine();
		
		int minS = Integer.MAX_VALUE;
		int tmpS = 0;
		
		for(int i = 0; i + t.length() <= ss.length(); i++) {
			
			String tmp = ss.substring(i, i + t.length());
			tmpS = 0;
			
			for(int j = 0; j < tmp.length(); j++) {
				
				if(tmp.charAt(j) != t.charAt(j))
					tmpS++;
				
			}
			
			if(tmpS < minS)
				minS = tmpS;
			
		}
		
		System.out.println(minS);
		

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner s = new Scanner(System.in);
		
		String ss = s.nextLine();
		String t = s.nextLine();
		
		int minS = Integer.MAX_VALUE;
		int tmpS = 0;
		
		for(int i = 0; i + t.length() <= ss.length(); i++) {
			
			String tmp = ss.substring(i, i + t.length());
			tmpS = 0;
			
			for(int j = 0; j < tmp.length(); j++) {
				
				if(tmp.charAt(j) != t.charAt(j))
					tmpS++;
				
			}
			
			if(tmpS < minS)
				minS = tmpS;
			
		}
		
		System.out.println(minS);
		

	}

}
