import java.util.*;
import java.math.RoundingMode;
import java.math.BigDecimal;
 
 
public class Main{
	public static void main (String[] args){
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		char[] t = sc.next().toCharArray();
		int l = t.length;
		int min = l;
			for(int i = 0; i < s.length-l+1; i++) {
				int count = 0;
				for(int j = 0; j < l; j++) {
					if(s[i+j]!=t[j])count++;
				}
				if(count<min)min=count;
			}
			System.out.println(min);
	}
} import java.util.*; util.* java import java.math.RoundingMode; RoundingMode java.math import java.math.BigDecimal; BigDecimal java.math public class Main{
	public static void main (String[] args){
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		char[] t = sc.next().toCharArray();
		int l = t.length;
		int min = l;
			for(int i = 0; i < s.length-l+1; i++) {
				int count = 0;
				for(int j = 0; j < l; j++) {
					if(s[i+j]!=t[j])count++;
				}
				if(count<min)min=count;
			}
			System.out.println(min);
	}
} Main public static void main (String[] args){
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		char[] t = sc.next().toCharArray();
		int l = t.length;
		int min = l;
			for(int i = 0; i < s.length-l+1; i++) {
				int count = 0;
				for(int j = 0; j < l; j++) {
					if(s[i+j]!=t[j])count++;
				}
				if(count<min)min=count;
			}
			System.out.println(min);
	} main {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		char[] t = sc.next().toCharArray();
		int l = t.length;
		int min = l;
			for(int i = 0; i < s.length-l+1; i++) {
				int count = 0;
				for(int j = 0; j < l; j++) {
					if(s[i+j]!=t[j])count++;
				}
				if(count<min)min=count;
			}
			System.out.println(min);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] s = sc.next().toCharArray(); s sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc char[] t = sc.next().toCharArray(); t sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc int l = t.length; l t.length t t.length int min = l; min l for(int i = 0; i < s.length-l+1; i++) {
				int count = 0;
				for(int j = 0; j < l; j++) {
					if(s[i+j]!=t[j])count++;
				}
				if(count<min)min=count;
			} int i = 0; int i = 0; i 0 i < s.length-l+1 i s.length-l+1 s.length-l s.length s s.length l 1 i++ i++ i {
				int count = 0;
				for(int j = 0; j < l; j++) {
					if(s[i+j]!=t[j])count++;
				}
				if(count<min)min=count;
			} {
				int count = 0;
				for(int j = 0; j < l; j++) {
					if(s[i+j]!=t[j])count++;
				}
				if(count<min)min=count;
			} int count = 0; count 0 for(int j = 0; j < l; j++) {
					if(s[i+j]!=t[j])count++;
				} int j = 0; int j = 0; j 0 j < l j l j++ j++ j {
					if(s[i+j]!=t[j])count++;
				} {
					if(s[i+j]!=t[j])count++;
				} if(s[i+j]!=t[j])count++; s[i+j]!=t[j] s[i+j] s i+j i j t[j] t j count++ count if(count<min)min=count; count<min count min min=count min count System.out.println(min) System.out.println System.out System System.out min String[] args args public class Main{
	public static void main (String[] args){
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		char[] t = sc.next().toCharArray();
		int l = t.length;
		int min = l;
			for(int i = 0; i < s.length-l+1; i++) {
				int count = 0;
				for(int j = 0; j < l; j++) {
					if(s[i+j]!=t[j])count++;
				}
				if(count<min)min=count;
			}
			System.out.println(min);
	}
} public class Main{
	public static void main (String[] args){
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		char[] t = sc.next().toCharArray();
		int l = t.length;
		int min = l;
			for(int i = 0; i < s.length-l+1; i++) {
				int count = 0;
				for(int j = 0; j < l; j++) {
					if(s[i+j]!=t[j])count++;
				}
				if(count<min)min=count;
			}
			System.out.println(min);
	}
} Main
import java.util.*;
import java.math.RoundingMode;
import java.math.BigDecimal;
 
 
public class Main{
	public static void main (String[] args){
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		char[] t = sc.next().toCharArray();
		int l = t.length;
		int min = l;
			for(int i = 0; i < s.length-l+1; i++) {
				int count = 0;
				for(int j = 0; j < l; j++) {
					if(s[i+j]!=t[j])count++;
				}
				if(count<min)min=count;
			}
			System.out.println(min);
	}
}