import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String t = sc.nextLine();

		String[] sArray = s.split("");
		String[] tArray = t.split("");

		int num_times = sArray.length - tArray.length + 1;

		String part = new String();

		int count = 9999;

		for (int i = 0; i < num_times;i++){

			StringBuilder sb = new StringBuilder();

			for(int j=i; j < i + tArray.length; j++){
				sb.append(sArray[j]);
			}
			part = sb.toString();

			//System.out.println(part);

			String[] partArray = part.split("");
			int currentCount = 0; 

			for(int k = 0; k < tArray.length; k++){

				if(!partArray[k].equals(tArray[k])){
					//System.out.println("P:"+ partArray[k] +"  " + "T:" + tArray[k]);
					currentCount ++;
					//System.out.println(currentCount);
				}
			}

			count =  currentCount < count ? currentCount : count;  
			// if(currentCount < count){
			// 	count = currentCount;
			// }
			//System.out.println(count);		
		}
		System.out.println(count);
		sc.close();	
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String t = sc.nextLine();

		String[] sArray = s.split("");
		String[] tArray = t.split("");

		int num_times = sArray.length - tArray.length + 1;

		String part = new String();

		int count = 9999;

		for (int i = 0; i < num_times;i++){

			StringBuilder sb = new StringBuilder();

			for(int j=i; j < i + tArray.length; j++){
				sb.append(sArray[j]);
			}
			part = sb.toString();

			//System.out.println(part);

			String[] partArray = part.split("");
			int currentCount = 0; 

			for(int k = 0; k < tArray.length; k++){

				if(!partArray[k].equals(tArray[k])){
					//System.out.println("P:"+ partArray[k] +"  " + "T:" + tArray[k]);
					currentCount ++;
					//System.out.println(currentCount);
				}
			}

			count =  currentCount < count ? currentCount : count;  
			// if(currentCount < count){
			// 	count = currentCount;
			// }
			//System.out.println(count);		
		}
		System.out.println(count);
		sc.close();	
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String t = sc.nextLine();

		String[] sArray = s.split("");
		String[] tArray = t.split("");

		int num_times = sArray.length - tArray.length + 1;

		String part = new String();

		int count = 9999;

		for (int i = 0; i < num_times;i++){

			StringBuilder sb = new StringBuilder();

			for(int j=i; j < i + tArray.length; j++){
				sb.append(sArray[j]);
			}
			part = sb.toString();

			//System.out.println(part);

			String[] partArray = part.split("");
			int currentCount = 0; 

			for(int k = 0; k < tArray.length; k++){

				if(!partArray[k].equals(tArray[k])){
					//System.out.println("P:"+ partArray[k] +"  " + "T:" + tArray[k]);
					currentCount ++;
					//System.out.println(currentCount);
				}
			}

			count =  currentCount < count ? currentCount : count;  
			// if(currentCount < count){
			// 	count = currentCount;
			// }
			//System.out.println(count);		
		}
		System.out.println(count);
		sc.close();	
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String t = sc.nextLine();

		String[] sArray = s.split("");
		String[] tArray = t.split("");

		int num_times = sArray.length - tArray.length + 1;

		String part = new String();

		int count = 9999;

		for (int i = 0; i < num_times;i++){

			StringBuilder sb = new StringBuilder();

			for(int j=i; j < i + tArray.length; j++){
				sb.append(sArray[j]);
			}
			part = sb.toString();

			//System.out.println(part);

			String[] partArray = part.split("");
			int currentCount = 0; 

			for(int k = 0; k < tArray.length; k++){

				if(!partArray[k].equals(tArray[k])){
					//System.out.println("P:"+ partArray[k] +"  " + "T:" + tArray[k]);
					currentCount ++;
					//System.out.println(currentCount);
				}
			}

			count =  currentCount < count ? currentCount : count;  
			// if(currentCount < count){
			// 	count = currentCount;
			// }
			//System.out.println(count);		
		}
		System.out.println(count);
		sc.close();	
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc String t = sc.nextLine(); t sc.nextLine() sc.nextLine sc String[] sArray = s.split(""); sArray s.split("") s.split s "" String[] tArray = t.split(""); tArray t.split("") t.split t "" int num_times = sArray.length - tArray.length + 1; num_times sArray.length - tArray.length + 1 sArray.length - tArray.length sArray.length sArray sArray.length tArray.length tArray tArray.length 1 String part = new String(); part new String() int count = 9999; count 9999 for (int i = 0; i < num_times;i++){

			StringBuilder sb = new StringBuilder();

			for(int j=i; j < i + tArray.length; j++){
				sb.append(sArray[j]);
			}
			part = sb.toString();

			//System.out.println(part);

			String[] partArray = part.split("");
			int currentCount = 0; 

			for(int k = 0; k < tArray.length; k++){

				if(!partArray[k].equals(tArray[k])){
					//System.out.println("P:"+ partArray[k] +"  " + "T:" + tArray[k]);
					currentCount ++;
					//System.out.println(currentCount);
				}
			}

			count =  currentCount < count ? currentCount : count;  
			// if(currentCount < count){
			// 	count = currentCount;
			// }
			//System.out.println(count);		
		} int i = 0; int i = 0; i 0 i < num_times i num_times i++ i++ i {

			StringBuilder sb = new StringBuilder();

			for(int j=i; j < i + tArray.length; j++){
				sb.append(sArray[j]);
			}
			part = sb.toString();

			//System.out.println(part);

			String[] partArray = part.split("");
			int currentCount = 0; 

			for(int k = 0; k < tArray.length; k++){

				if(!partArray[k].equals(tArray[k])){
					//System.out.println("P:"+ partArray[k] +"  " + "T:" + tArray[k]);
					currentCount ++;
					//System.out.println(currentCount);
				}
			}

			count =  currentCount < count ? currentCount : count;  
			// if(currentCount < count){
			// 	count = currentCount;
			// }
			//System.out.println(count);		
		} {

			StringBuilder sb = new StringBuilder();

			for(int j=i; j < i + tArray.length; j++){
				sb.append(sArray[j]);
			}
			part = sb.toString();

			//System.out.println(part);

			String[] partArray = part.split("");
			int currentCount = 0; 

			for(int k = 0; k < tArray.length; k++){

				if(!partArray[k].equals(tArray[k])){
					//System.out.println("P:"+ partArray[k] +"  " + "T:" + tArray[k]);
					currentCount ++;
					//System.out.println(currentCount);
				}
			}

			count =  currentCount < count ? currentCount : count;  
			// if(currentCount < count){
			// 	count = currentCount;
			// }
			//System.out.println(count);		
		} StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int j=i; j < i + tArray.length; j++){
				sb.append(sArray[j]);
			} int j=i; int j=i; j i j < i + tArray.length j i + tArray.length i tArray.length tArray tArray.length j++ j++ j {
				sb.append(sArray[j]);
			} {
				sb.append(sArray[j]);
			} sb.append(sArray[j]) sb.append sb sArray[j] sArray j part = sb.toString() part sb.toString() sb.toString sb String[] partArray = part.split(""); partArray part.split("") part.split part "" int currentCount = 0; currentCount 0 for(int k = 0; k < tArray.length; k++){

				if(!partArray[k].equals(tArray[k])){
					//System.out.println("P:"+ partArray[k] +"  " + "T:" + tArray[k]);
					currentCount ++;
					//System.out.println(currentCount);
				}
			} int k = 0; int k = 0; k 0 k < tArray.length k tArray.length tArray tArray.length k++ k++ k {

				if(!partArray[k].equals(tArray[k])){
					//System.out.println("P:"+ partArray[k] +"  " + "T:" + tArray[k]);
					currentCount ++;
					//System.out.println(currentCount);
				}
			} {

				if(!partArray[k].equals(tArray[k])){
					//System.out.println("P:"+ partArray[k] +"  " + "T:" + tArray[k]);
					currentCount ++;
					//System.out.println(currentCount);
				}
			} if(!partArray[k].equals(tArray[k])){
					//System.out.println("P:"+ partArray[k] +"  " + "T:" + tArray[k]);
					currentCount ++;
					//System.out.println(currentCount);
				} !partArray[k].equals(tArray[k]) partArray[k].equals(tArray[k]) partArray[k].equals partArray[k] partArray k tArray[k] tArray k {
					//System.out.println("P:"+ partArray[k] +"  " + "T:" + tArray[k]);
					currentCount ++;
					//System.out.println(currentCount);
				} currentCount ++ currentCount count =  currentCount < count ? currentCount : count count currentCount < count ? currentCount : count currentCount < count currentCount count currentCount count System.out.println(count) System.out.println System.out System System.out count sc.close() sc.close sc String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String t = sc.nextLine();

		String[] sArray = s.split("");
		String[] tArray = t.split("");

		int num_times = sArray.length - tArray.length + 1;

		String part = new String();

		int count = 9999;

		for (int i = 0; i < num_times;i++){

			StringBuilder sb = new StringBuilder();

			for(int j=i; j < i + tArray.length; j++){
				sb.append(sArray[j]);
			}
			part = sb.toString();

			//System.out.println(part);

			String[] partArray = part.split("");
			int currentCount = 0; 

			for(int k = 0; k < tArray.length; k++){

				if(!partArray[k].equals(tArray[k])){
					//System.out.println("P:"+ partArray[k] +"  " + "T:" + tArray[k]);
					currentCount ++;
					//System.out.println(currentCount);
				}
			}

			count =  currentCount < count ? currentCount : count;  
			// if(currentCount < count){
			// 	count = currentCount;
			// }
			//System.out.println(count);		
		}
		System.out.println(count);
		sc.close();	
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String t = sc.nextLine();

		String[] sArray = s.split("");
		String[] tArray = t.split("");

		int num_times = sArray.length - tArray.length + 1;

		String part = new String();

		int count = 9999;

		for (int i = 0; i < num_times;i++){

			StringBuilder sb = new StringBuilder();

			for(int j=i; j < i + tArray.length; j++){
				sb.append(sArray[j]);
			}
			part = sb.toString();

			//System.out.println(part);

			String[] partArray = part.split("");
			int currentCount = 0; 

			for(int k = 0; k < tArray.length; k++){

				if(!partArray[k].equals(tArray[k])){
					//System.out.println("P:"+ partArray[k] +"  " + "T:" + tArray[k]);
					currentCount ++;
					//System.out.println(currentCount);
				}
			}

			count =  currentCount < count ? currentCount : count;  
			// if(currentCount < count){
			// 	count = currentCount;
			// }
			//System.out.println(count);		
		}
		System.out.println(count);
		sc.close();	
	}
} Main
import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String t = sc.nextLine();

		String[] sArray = s.split("");
		String[] tArray = t.split("");

		int num_times = sArray.length - tArray.length + 1;

		String part = new String();

		int count = 9999;

		for (int i = 0; i < num_times;i++){

			StringBuilder sb = new StringBuilder();

			for(int j=i; j < i + tArray.length; j++){
				sb.append(sArray[j]);
			}
			part = sb.toString();

			//System.out.println(part);

			String[] partArray = part.split("");
			int currentCount = 0; 

			for(int k = 0; k < tArray.length; k++){

				if(!partArray[k].equals(tArray[k])){
					//System.out.println("P:"+ partArray[k] +"  " + "T:" + tArray[k]);
					currentCount ++;
					//System.out.println(currentCount);
				}
			}

			count =  currentCount < count ? currentCount : count;  
			// if(currentCount < count){
			// 	count = currentCount;
			// }
			//System.out.println(count);		
		}
		System.out.println(count);
		sc.close();	
	}
}
