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();	
	}
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz