import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
      	String t = sc.next();
      	int slen = s.length();
      	int tlen = t.length();
      	int min = 10000;
      	for(int i=0;i<slen-tlen+1;i++){
          int count = 0;
          for(int j=0;j<tlen;j++){
            if( s.charAt(i+j) == t.charAt(j) ){
              count++;
            }
          }
          if( tlen - count < min ){
            min = tlen - count;
          }
        }
      System.out.println(min);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
      	String t = sc.next();
      	int slen = s.length();
      	int tlen = t.length();
      	int min = 10000;
      	for(int i=0;i<slen-tlen+1;i++){
          int count = 0;
          for(int j=0;j<tlen;j++){
            if( s.charAt(i+j) == t.charAt(j) ){
              count++;
            }
          }
          if( tlen - count < min ){
            min = tlen - count;
          }
        }
      System.out.println(min);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
      	String t = sc.next();
      	int slen = s.length();
      	int tlen = t.length();
      	int min = 10000;
      	for(int i=0;i<slen-tlen+1;i++){
          int count = 0;
          for(int j=0;j<tlen;j++){
            if( s.charAt(i+j) == t.charAt(j) ){
              count++;
            }
          }
          if( tlen - count < min ){
            min = tlen - count;
          }
        }
      System.out.println(min);
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
      	String t = sc.next();
      	int slen = s.length();
      	int tlen = t.length();
      	int min = 10000;
      	for(int i=0;i<slen-tlen+1;i++){
          int count = 0;
          for(int j=0;j<tlen;j++){
            if( s.charAt(i+j) == t.charAt(j) ){
              count++;
            }
          }
          if( tlen - count < min ){
            min = tlen - count;
          }
        }
      System.out.println(min);
	} 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 int slen = s.length(); slen s.length() s.length s int tlen = t.length(); tlen t.length() t.length t int min = 10000; min 10000 for(int i=0;i<slen-tlen+1;i++){
          int count = 0;
          for(int j=0;j<tlen;j++){
            if( s.charAt(i+j) == t.charAt(j) ){
              count++;
            }
          }
          if( tlen - count < min ){
            min = tlen - count;
          }
        } int i=0; int i=0; i 0 i<slen-tlen+1 i slen-tlen+1 slen-tlen slen tlen 1 i++ i++ i {
          int count = 0;
          for(int j=0;j<tlen;j++){
            if( s.charAt(i+j) == t.charAt(j) ){
              count++;
            }
          }
          if( tlen - count < min ){
            min = tlen - count;
          }
        } {
          int count = 0;
          for(int j=0;j<tlen;j++){
            if( s.charAt(i+j) == t.charAt(j) ){
              count++;
            }
          }
          if( tlen - count < min ){
            min = tlen - count;
          }
        } int count = 0; count 0 for(int j=0;j<tlen;j++){
            if( s.charAt(i+j) == t.charAt(j) ){
              count++;
            }
          } int j=0; int j=0; j 0 j<tlen j tlen j++ j++ j {
            if( s.charAt(i+j) == t.charAt(j) ){
              count++;
            }
          } {
            if( s.charAt(i+j) == t.charAt(j) ){
              count++;
            }
          } if( s.charAt(i+j) == t.charAt(j) ){
              count++;
            } s.charAt(i+j) == t.charAt(j) s.charAt(i+j) s.charAt s i+j i j t.charAt(j) t.charAt t j {
              count++;
            } count++ count if( tlen - count < min ){
            min = tlen - count;
          } tlen - count < min tlen - count tlen count min {
            min = tlen - count;
          } min = tlen - count min tlen - count tlen 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);
		String s = sc.next();
      	String t = sc.next();
      	int slen = s.length();
      	int tlen = t.length();
      	int min = 10000;
      	for(int i=0;i<slen-tlen+1;i++){
          int count = 0;
          for(int j=0;j<tlen;j++){
            if( s.charAt(i+j) == t.charAt(j) ){
              count++;
            }
          }
          if( tlen - count < min ){
            min = tlen - count;
          }
        }
      System.out.println(min);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
      	String t = sc.next();
      	int slen = s.length();
      	int tlen = t.length();
      	int min = 10000;
      	for(int i=0;i<slen-tlen+1;i++){
          int count = 0;
          for(int j=0;j<tlen;j++){
            if( s.charAt(i+j) == t.charAt(j) ){
              count++;
            }
          }
          if( tlen - count < min ){
            min = tlen - count;
          }
        }
      System.out.println(min);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
      	String t = sc.next();
      	int slen = s.length();
      	int tlen = t.length();
      	int min = 10000;
      	for(int i=0;i<slen-tlen+1;i++){
          int count = 0;
          for(int j=0;j<tlen;j++){
            if( s.charAt(i+j) == t.charAt(j) ){
              count++;
            }
          }
          if( tlen - count < min ){
            min = tlen - count;
          }
        }
      System.out.println(min);
	}
}